C Output Questions
- Find Error/Output in follwing code:
- 128
- 129
- 130
- 131
void main ()
{
int x = 128;
printf ("n%d", 1 + x++);
}
Added By : Justin
- Find Error/Output in follwing code:
- 20 10 10
- 20 10 20
- 20 20 20
- 10 10 10
#include <stdio.h>
int tmp=20;
main( ) {
printf("%d ",tmp);
func( );
printf("%d ",tmp);
}
func() {
static int tmp=10;
printf("%d ",tmp);
}
Added By : Sunny
- Find Error/Output in follwing code:
- 10 and 11
- 10
- 11
- 11 and 11
main() {
int a = 10;
if ((fork ( ) == 0))
a++;
printf ("%dn", a );
}
Added By : Sandhya
- Find Error/Output in follwing code:
- 10 11 12 13 14
- 10 10 10 10 10
- 0 1 2 3 4
- Compilation error
#include <stdio.h>
main( ) {
int i;
for ( i=0; i<5; i++ ) {
int i = 10;
printf ( " %d", i );
i++;
}
return 0;
}
Added By : Himanshu
- Find Error/Output in follwing code:
- 6, 10, 8
- 4, 8, 4
- 2, 4, 4
- 2, 8, 8
struct
{
int si;
double d;
float cp;
} s;
void
main ()
{
printf ("%d, %d, %d", sizeof (s.si), sizeof (s.d), sizeof (s.cp));
}
Added By : Jatin
- Find Error/Output in follwing code:
- 5 3 7 3
- 5 4 5 3
- 6 2 6 4
- Syntax Error
int main ()
{
int a, b;
a = b = 4;
b = a++;
printf ("%d %d %d %d", a++, --b, ++a, b--);
}
Added By : Irfan
- Find Error/Output in follwing code:
- Syntax error because of invalid operator symbol
- 25 16
- 16 16
- Syntax error because of invalid array initialization
int main ()
{
int a[4] = { 25, 16 };
printf ("%d %d", a[0] & a[1], a[1] | a[2]);
}
Added By : Rishab
- Find Error/Output in follwing code:
- 8 6 4 2
- Infinite output
- Invalid because main function can't call itself.
- 6 4 2 0
int main ()
{
static int num = 8;
printf ("%d", num = num - 2);
if (num != 0)
main ();
}
Added By : Rohit
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