PRG29002-2015-2-Aval1B: mudanças entre as edições
Ir para navegação
Ir para pesquisar
Criou página com 'Nome:_____________________________________________ Questão 1 <syntaxhighlight lang=c> #include <stdio.h> main () { int x,y,z; x=2; y=6; y=y%x; z = ( ( x-1 || y>5 ) && !0 ) *...' |
Sem resumo de edição |
||
Linha 19: | Linha 19: | ||
Z = ______ | Z = ______ | ||
Questão 2 | |||
<syntaxhighlight lang=c> | |||
#include <stdio.h> | |||
main () | |||
{ | |||
int x,y; | |||
x=8; | |||
y=2; | |||
if (x>5 && !(y==1)){ | |||
y=x+y; | |||
x++; | |||
if (x>30) y++; | |||
else y--; | |||
y=y+4; | |||
if (y>2) { | |||
if (y==0) | |||
x=0; | |||
else | |||
x=9; | |||
x=x+1; | |||
} | |||
x=x*2; | |||
} else { | |||
y=y*3; | |||
x=y+2; | |||
} | |||
printf("x= %d e y=%d\n",x,y); | |||
} | |||
</syntaxhighlight> | |||
X=____ | |||
y=____ |
Edição das 22h29min de 17 de novembro de 2015
Nome:_____________________________________________
Questão 1
#include <stdio.h>
main ()
{
int x,y,z;
x=2;
y=6;
y=y%x;
z = ( ( x-1 || y>5 ) && !0 ) * 12;
printf ("z=%d\n",z);
}
Z = ______
Questão 2
#include <stdio.h>
main ()
{
int x,y;
x=8;
y=2;
if (x>5 && !(y==1)){
y=x+y;
x++;
if (x>30) y++;
else y--;
y=y+4;
if (y>2) {
if (y==0)
x=0;
else
x=9;
x=x+1;
}
x=x*2;
} else {
y=y*3;
x=y+2;
}
printf("x= %d e y=%d\n",x,y);
}
X=____
y=____