Statements: Week: 3 Duration: 60 Mins
Statements: Week: 3 Duration: 60 Mins
3. Statements
Week : 3 Duration : 60 mins
17
‘C’ & ‘C’ only Sona Placement & Training Cell
18
‘C’ & ‘C’ only Sona Placement & Training Cell
19
‘C’ & ‘C’ only Sona Placement & Training Cell
20
‘C’ & ‘C’ only Sona Placement & Training Cell
23.
int a,b;
1.main()
2.{
3.scanf(“............”,&a,&b);
4.if...........{
5.printf(“Print A”);
6.else
7.Printf(“...........”);
8.endif}
9..........
24.In the (generic) code segment below what will be the value of the variable i
at completion ?
i = 0;
j = 0;
for(j=1;j<10;j++)
i=i+1;
a) 0 b) 1 c) 3 d) 9
21
‘C’ & ‘C’ only Sona Placement & Training Cell
3. Assignment
22
‘C’ & ‘C’ only Sona Placement & Training Cell
30. The statement that prints out the character set from A-Z, is
a) for( a = `z`; a < `a`; a = a - 1) printf(“%c”, &a);
b) for( a = `a`; a <= `z`; a = a + 1) printf(“%c”, &a);
c) for( a = `A`; a <= `Z`; a = a + 1) printf(“%c”, a);
d) for( a = `Z`; a <= `A`; a = a + 1) printf(“%c”, a);
31. The statement which prints out the values 1 to 10 on separate lines, is
a) for( count = 1; count <= 10; count = count + 1) printf(“%d\n”, count);
b) for( count = 1; count < 10; count = count + 1) printf(“%d\n”, count);
c) for( count = 0; count <= 9; count = count + 1) printf(“%d “, count);
d) for( count = 1; count <> 10; count = count + 1) printf(“%d\n”, count);
23