You are on page 1of 2

11>

#include <stdio.h>
int main()
{
int i = -3, j = 2, k = 0, m;
m = ++i && ++j || ++k;
printf("%d %d %d %d", i, j, k, m);
return 0;
}
12>
#include <stdio.h>
int main()
{
int i = -3, j = 2, k = 0, m;
m = ++i || ++j && ++k;
printf("%d %d %d %d", i, j, k, m);
return 0;
}
13>
#include <stdio.h>
int main()
{
int i = -3, j = 2, k = 0, m;
m = ++i && ++j && ++k;
printf("%d %d %d %d", i, j, k, m);
return 0;
}
14>
#include <stdio.h>
int main()
{
int i = 2;
int j = i + (1, 2, 3, 4, 5);
printf("%d", j); return 0;
}
15>
#include <stdio.h>
int main()
{
int x = 55;
printf("%d %d %d",x<=55,x=40,x>=10);
return 0;
}
16>
#include <stdio.h>
int main()
{
int a = 100, b = 200, c;
c = (a == 100 || b > 200);
printf("c = %d", c);
return 0;
}

17>
#include <stdio.h>
int main()
{
int x = 12, y = 7, z;
z = x != 4 || y == 2;
printf("z = %d", z);
return 0;
}
18>
#include <stdio.h>
int main()
{
int i = 4, j = -1, k = 0, w,x,y,z;
w = i || j || k;
x = i && j && k;
y = i || j && k;
z = i && j || k;
printf("%d %d %d %d", w, x, y, z);
return 0;
}
19>
#include <stdio.h>
int main()
{
int x, y, z;
x = y = z = 1;
z = ++x || ++y && ++z;
printf("x=%d y=%d z=%d", x, y, z);
return 0;
}
20>
#include <stdio.h>
int main()
{
int x, y, z;
x = y = z = 1;
printf("x=%d y=%d z=%d",++x,y++,++z);
return 0;
}
ANSWERS
01.
11.
02.
12.
03.
13.
04.
14.
05.
15.
06.
16.
07.
17.
08.
18.
09.
19.
10.
20.

B.Bhuvaneswaran, Assistant Professor (SS) / Dept. of CSE / Rajalakshmi Engineering College

B.Bhuvaneswaran, Assistant Professor (SS) / Dept. of CSE / Rajalakshmi Engineering College

What will be the o/p of the foll. Pgm.?


01>
#include <stdio.h>
int main()
{
int a, b;
a = -3 - -3;
b = -3 - -(-3);
printf("a = %d b = %d", a, b);
return 0;
}
02>
#include <stdio.h>
int main()
{
int x;
x = 3 * 4 % 5;
printf("x = %d", x);
return 0;
}
03>
#include <stdio.h>
int main()
{
int x;
x = 3 + 4 - 7 * 8 / 5 % 10;
printf("x = %d", x);
return 0;
}
04>
#include <stdio.h>
int main()
{
printf("%d\t", 4 / 3);
printf("%d\t", 4 / -3);
printf("%d\t", -4 / 3);
printf("%d", -4 / -3);
return 0;
}
05>
#include <stdio.h>
int main()
{
printf("%d\t", 4 % 3);
printf("%d\t", 4 % -3);
printf("%d\t", -4 % 3);
printf("%d", -4 % -3);
return 0;
}
B.Bhuvaneswaran, Assistant Professor (SS) / Dept. of CSE / Rajalakshmi Engineering College

06>
#include <stdio.h>
int x = 40;
int main()
{
int x = 20;
printf("%d", x);
return 0;
}
07>
#include <stdio.h>
int main()
{
int x = 40;
{
int x = 20;
printf("%d\t", x);
}
printf("%d", x);
return 0;
}
08>
#include <stdio.h>
int main()
{
int x = 10, y = 20, z = 5, i;
i = x < y < z;
printf("%d", i); return 0;
}
09>
#include <stdio.h>
int main()
{
enum status {pass, fail, atkt};
enum status stud1, stud2, stud3;
stud1 = pass;
stud2 = atkt;
stud3 = fail;
printf("%d %d %d", stud1,stud2,stud3);
return 0;
}
10>
#include <stdio.h>
int main()
{
int x = 4, y, z;
y = --x; z = x--;
printf("%d %d %d", x, y, z);
return 0;
}

B.Bhuvaneswaran, Assistant Professor (SS) / Dept. of CSE / Rajalakshmi Engineering College

You might also like