Untitled
unknown
plain_text
10 months ago
610 B
8
Indexable
// 1)
int x, y;
x = 3; y = x+1;
x = x*y; y = x + y;
printf("%d %d\n", x, y);
// output: x = 12; y = 16;
// 2)
int x, y;
x = 0;
printf ("%d %d\n", x, y);
// output: Erro, y nao definido
// 3)
char a, b, c;
a = 'A'; b = ’ ’; c = ’0’;
printf ("%c %d\n", a, a);
a = a+1; c = c+2;
printf ("%c %d %c %d\n", a, a, c, c);
c = a + b;
printf ("%c %d\n", c, c);
/* output : A, 65 */
// 4)
int x, y;
x = 200; y = 100;
x = x+y; y = x-y;
x = x-y;
printf ("%d %d\n", x, y);
// output: x = 100, y = 200
// 5)
int x, y;
x = 3; y = 5;
if (x > y)
y = 6;
printf ("%d %d\n", x, y);
// output: x = 3, y = 5Editor is loading...
Leave a Comment