74. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011  »  Posted By  »  Total 0 Comment
1
2
3
4
5
 main()
{
	int i=5,j=6,z;
	printf("%d",i+++j);
}

73. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011  »  Posted By  »  Total 1 Comment
1
2
3
4
5
6
7
#include "stdio.h"
main()
{
	register i=5;
    char j[]= "hello";                     
    printf("%s  %d",j,i);
}

72. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011  »  Posted By  »  Total 0 Comment
1
2
3
4
5
6
7
8
9
#include "stdio.h"
main()
{
	int a[2][2][2] = { {10,2,3,4}, {5,6,7,8}  };
	int *p,*q;
	p=&a[2][2][2];
	*q=***a;
	printf("%d..%d",*p,*q);
}

71. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011  »  Posted By  »  Total 2 Comments
1
2
3
4
5
6
7
8
 #include "stdio.h"
main()
{
	const int i=4;
	float j;
	j = ++i;
	printf("%d  %f", i,++j);
}

70. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011  »  Posted By  »  Total 0 Comment
1
2
3
4
5
6
 main()
	{
		int i=-1;
		-i;
		printf("i = %d, -i = %d \n",i,-i);
	}

69. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011  »  Posted By  »  Total 0 Comment
1
2
3
4
5
6
7
8
9
 main()
{
	int *j;
	{
		int i=10;
		j=&i;
	}
	printf("%d",*j);
}

68. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011  »  Posted By  »  Total 0 Comment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
int i=10;
main()
{
extern int i;
	{
		int i=20;
		{
			const volatile unsigned i=30;
			printf("%d",i);
		}
		printf("%d",i);
	}
	printf("%d",i);
}

67. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011  »  Posted By  »  Total 0 Comment
1
2
3
4
5
6
7
8
9
#define max 5
#define int arr1[max]
main()
{
	typedef char arr2[max];
	arr1 list={0,1,2,3,4};
	arr2 name="name";
	printf("%d %s",list[0],name);
}

66. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011  »  Posted By  »  Total 1 Comment
1
2
3
4
5
6
7
8
9
 main()
{
	int y;
	scanf("%d",&y); // input given is 2000
	if( (y%4==0 && y%100 != 0) || y%100 == 0 )
	    printf("%d is a leap year");
	else
		printf("%d is not a leap year");
}

65. Predict the output or error(s) of the following c code

Monday, September 5th, 2011  »  Posted By  »  Total 0 Comment
1
2
3
4
5
 main()
{
	int k=1;
	printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE");
}
Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup

Email: