Mudanças entre as edições de "PRG29002-2015-2-Aval1A"
Ir para navegação
Ir para pesquisar
Linha 3: | Linha 3: | ||
Nome:_____________________________________________ | Nome:_____________________________________________ | ||
− | Questão 1 | + | =Questão 1= |
<syntaxhighlight lang=c> | <syntaxhighlight lang=c> | ||
Linha 22: | Linha 22: | ||
Z = ______ | Z = ______ | ||
− | Questão 2 | + | =Questão 2= |
<syntaxhighlight lang=c> | <syntaxhighlight lang=c> | ||
Linha 61: | Linha 61: | ||
− | + | =Questão 3= | |
<syntaxhighlight lang=c> | <syntaxhighlight lang=c> | ||
Linha 83: | Linha 83: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | =Questão 4= | ||
+ | |||
+ | <syntaxhighlight lang=c> | ||
+ | /* indicar o valor impresso das variáveis */ | ||
+ | #include <stdio.h> | ||
+ | |||
+ | main () | ||
+ | { | ||
+ | int i,j,x=1,soma=1; | ||
+ | |||
+ | for (i=0;i<2;i++) { | ||
+ | for (j=0;j<3;j++) | ||
+ | x=j+i; | ||
+ | soma = soma + i; | ||
+ | } | ||
+ | printf("Valor de soma = %d x=%d i=%d j=%d\n", soma,x,i,j); | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | x=_____ | ||
+ | |||
+ | soma=______ |
Edição das 22h37min 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 ) * 10;
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+5;
if (y>2) {
if (y==0)
x=0;
else
x=9;
x=x+1;
}
x=x*3;
} else {
y=y*2;
x=y+1;
}
printf("x= %d e y=%d\n",x,y);
}
X=____
y=____
Questão 3
/* indicar o valor impresso das variáveis */
#include <stdio.h>
main ()
{
int i,soma=0;
for (i=4;i>0;i=i-1)
soma = soma + i;
printf("Valor de soma = %d e i= %d\n", soma,i);
}
i=_____
soma=_______
Questão 4
/* indicar o valor impresso das variáveis */
#include <stdio.h>
main ()
{
int i,j,x=1,soma=1;
for (i=0;i<2;i++) {
for (j=0;j<3;j++)
x=j+i;
soma = soma + i;
}
printf("Valor de soma = %d x=%d i=%d j=%d\n", soma,x,i,j);
}
x=_____
soma=______