C Output Questions
- Find Error/Output in follwing code:
- D.W.Steyn
- D.W.Steyn M.G.Johnson
- M.G.Johnson
- M.G.Johnson Mohammad Asif M.Muralidaran
int main ()
{
int check = 2;
switch (check)
{
case 1:
printf ("D.W.Steyn");
case 2:
printf (" M.G.Johnson");
case 3:
printf (" Mohammad Asif");
default:
printf (" M.Muralidaran");
}
return 0;
}
Added By : Abhilasha
- Find Error/Output in follwing code:
- 6 5
- 5 6
- 4 5
- 5 4
int main ()
{
int a = 5;
float b;
printf ("%d", sizeof (++a + b));
printf (" %d", a);
return 0;
}
Added By : Shiva
- Find Error/Output in follwing code:
- -10 0
- 10 20
- 20 -10
- 0 1
int main() {
int m = -10, n = 20;
n = (m < 0) ? 0 : 1;
printf("%d %d", m, n);
}
Added By : Vijay
- Find Error/Output in follwing code:
- 0 times
- Infinite times
- 10 times
- 1 times
int main() {
int i=0;
for(;;)
printf("%d",i);
return 0;
}
Added By : Pankaj
- Find Error/Output in follwing code:
- Red Green Blue
- Error
- Green unknown colour Red
- unknown colour Red Green
int main() {
char c = 'f';
switch (c) {
default: printf("unknown colour ");
case 'r': case 'R': printf("Red ");
case 'g': case 'G': printf("Green "); break;
case 'b': case 'B': printf("Blue");
}
}
Added By : Abhishek
- Find Error/Output in follwing code:
- Low values with a = 100 b = 74
- Low values with a = 101 b = 73
- Low values with a = 102 b = 75
- Low values with a = 104 b = 75
int main() {
int a = 100, b = 74;
if (a++ > 100 && b++ > 200)
printf("High values with a = %d b = %dn", a, b);
if (a++ < 100 || b++ < 200)
printf("Low values with a = %d b = %dn", a, b);
}
Added By : Jayesh
- Find Error/Output in follwing code:
- c k=40
- b k=44
- A k=42
- a k=40
int main() {
char p[] = "%dn";
p[1] = 'c';
printf(p, 65);
int k=40, *a;
a = &k;
(*a)++; k++;
printf("n k=%d",k);
}
Added By : Tarun
- Find Error/Output in follwing code:
- hello
- No output
- Infinite time hello display
- Error in code
int main() {
int x = 1;
while(x = 0)
printf("hello");
}
Added By : Nikita
Also Exercise
Post Your Question
Social Sharing
Search
Articles
Recently Added Jobs
Rajasthan High Court - Jodhpur Recruitment 2017 for Civil Judges
Last Date: 21 December, 2017
Last Date: 21 December, 2017
WBSEDCL Recruitment - 2017 for Office Executive
Last Date: 16 May, 2017
Last Date: 16 May, 2017
RECRUITMENT OF PROBATIONARY OFFICERS IN STATE BANK OF INDIA
Last Date: 06 March, 2017
Last Date: 06 March, 2017
UPSC Combined Medical Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015
UPSC Engineering Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015