PR1022804 2021 1 AULA06b
Correção da AT1
Gabarito: https://wiki.sj.ifsc.edu.br/index.php/Arquivo:Gabarito_-_PR1022804_2021_1_AT1.pdf
- Por que as questões são FALSAS?
- Questão 1
- a) O texto diz respeito a pseudocódigo não a fluxograma.
- d) Uma receita é um algoritmo.
- Questão 2
- b) O texto se refere a entradas não a saídas.
- d) O computador não faz tudo sozinho.
- Questão 3
- a), b) e c) Não são a ordem correta.
- Questão 4
- Execute o código:
#include <stdio.h>
int main()
{
int x=5, y=3, z=1;
printf("\n (x*(y+z)/2)==%d", (x*(y+z)/2) );
printf("\n (x%%y+(11%%y))==%d", (x%y+(11%y)) );
printf("\n (5-(x/(z+1)-y))==%d", (5-(x/(z+1)-y)) );
printf("\n (x/y/z*-1)==%d", (x/y/z*-1) );
return 0;
}
- a) (x*(y+z)/2)==10 verdadeiro
- b) (x%y+(11%y))==4 verdadeiro
- c) (5-(x/(z+1)-y))==6 falso
- d) (x/y/z*-1)==-1 falso
- Questão 5
- Execute o código e observe o resultado:
- 1 - verdadeiro
- 0 - falso
#include <stdio.h>
int main()
{
int x=1, y=-1, z=0;
printf("\n (z-x)!==y => %d", (z-x)!=y );
printf("\n (x>=y)&&(y>=z)||(1) => %d", (x>=y)&&(y>=z)||(1) );
printf("\n (!(y+x)==z) => %d", (!(y+x)==z) );
printf("\n (z<y)||(z==0) => %d", (z<y)||(z==0) );
return 0;
}
- a) (z-x)!==y => 0
- b) (x>=y)&&(y>=z)||(1) => 1
- c) (!(y+x)==z) => 0
- d) (z<y)||(z==0) => 1