Set-1 PC Fundamentals Home Assignment
Set-1 PC Fundamentals Home Assignment
1.20 What will be output of the following c 1.24 What would be the output ?
program? void main()
#include<stdio.h> {
int main() int x=10, y=17;
{ if(x>y)
int x=1,y=2; printf(“KIIT”);
y=++x; else if (x-y)
x=y++; printf(“KISS”);
y=x--; else
printf(“\n%d=%d”,x,y); printf(“KIMS”);
return 0; }
}
1.25 What will be output of the following c
1.21 What will be output of the following c program?
program? #include<stdio.h>
#include<stdio.h> int main()
int main() {
{ int x=1,y= -2;
int x=3,y=4,z=5; if(x=y);
x=y==z; {
printf(“%d”,x+y+z); x=x+y;
return 0; }
} printf(“%d”,x+y);
return 0;
1.22 What is the output of the following program }
segment?
int main() 1.26 What will be output of the following c
{ program?
int a; float b; char c; void main( )
printf(“%d,%d,%d”,sizeof(a), sizeof(b), {
sizeof(c)); int x=5;
return 0; if (1>x<8)
} printf ("WORLD');
else
1.23 What is the output of the following program printf ("UNIVERSE')
segment? return 0;
int main() }
{
int si,sj,sk,sl,sm; 1.27 What will be output of the following c
si= sizeof(1); program?
sj= sizeof(‘1’); int main()
sk= sizeof(“1”); {
int x=0,y= 1, z=-2; 1.34 WAP swap the contents of two variables
if(x>y || y<z && z>x) without using a third variable.
printf(“CSIT”); 1.35 WAP to add two times in hour, minitue &
else second format entered through the keyboard
printf(“OTHERS”); in the format hh:mm:ss
return 0;
}