Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

C PROGRAM QUESTIONS : PART 30

What will be the output of the following statements ?
int a = 5, b = 2, c = 10, i = a>b
void main()
{ printf("hello"); main(); }

1
2
infinite number of times
none of these
SHOW ANSWER

What will be output if you will compile and execute the following c code?
struct marks{
int p:3;
int c:3;
int m:2;
};
void main(){
struct marks s={2,-6,5};
printf("%d %d %d",s.p,s.c,s.m);
}

2 -6 5
2 -6 5
2 2 1
Compiler error
 None of these
SHOW ANSWER

What will be the output of the following statements ?
int x[4] = {1,2,3}; printf("%d %d %D",x[3],x[2],x[1]);

03%D
000
 032
 321
SHOW ANSWER

What will be the output of the following statement ?
printf( 3 + "goodbye");

goodbye
odbye
bye
 dbye
SHOW ANSWER

What will be the output of the following statements ?
long int a = scanf("%ld%ld",&a,&a); printf("%ld",a);

error
 garbage value
0
2
SHOW ANSWER

 What will be the output of the following program ?

SHOW ANSWER

What will be the output of the following program ?
#include
void main()
{ int a = 2;
switch(a)
{ case 1:
printf("goodbye"); break;
case 2:
continue;
case 3:
printf("bye");
}
}

error
goodbye
bye
byegoodbye
SHOW ANSWER

What will be the output of the following statements ?
int i = 1,j; j=i--- -2; printf("%d",j);

error.
 2
 3
-3
SHOW ANSWER

What will be the output of following program ?
#include
main()
{
int x,y = 10;
x = y * NULL;
printf("%d",x);
}

error
0
 10
 garbage value
SHOW ANSWER

What will be the output of following statements ?
char x[ ] = "hello hi"; printf("%d%d",sizeof(*x),sizeof(x));

88
18
29
19
19
SHOW ANSWER

What will be the output of the following statements ?
int a=5,b=6,c=9,d; d=(ac?1:2):(c>b?6:8)); printf("%d",d);

1
 2
 6
Error
SHOW ANSWER

What will be the output of the following statements ?
int i = 3;
printf("%d%d",i,i++);

34
43
44
33
SHOW ANSWER

What will be the output of the following program ?
#include
void main()
{
int a = 36, b = 9;
printf("%d",a>>a/b-2);
}

9
7
 5
none of these
SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in