CSE-105 CT-1 Question
CSE-105 CT-1 Question
Time: 35 minutes
No Question Marks
1 #include<stdio.h>
2
3 int main{}
4 {
5 Float f1,f2;
6 print(“Enter two numbers: );
7 scant(“%f%f”, &f1,&f2);
8 float 2sum=f1+f2
9 printf(“The sum is %d”, &2sum);
10 }
1 #include<stdio.h>
2 int main()
3 {
4 int x,y;
5 x=y=2;
6 y+= ++x;
7 x=x << y-- ;
8 y=y<< --y;
9 printf("%d %d", x>>2,y);
10 }
3. Code 1: Code 2:
5
#include<stdio.h> #include<stdio.h>
int main() int main()
{ {
int i=5; int i=5;
while(i>5) { do{
printf(“Happy New Year\n”); printf(“Happy New Year\n”);
i--; i--;
} }
} while(i>5);
}
Analyze the above code snippets. Show and explain the output of both the
codes.