Question 4
Assume that the size of an integer is 4 bytes. Predict the output?
#include <stdio.h>
int fun()
{
puts(\" Hello \");
return 10;
}
int main()
{
printf(\"%d\", sizeof(fun()));
return 0;
}
Question 6
#include <stdio.h>
int main()
{
int a[][3] = {1, 2, 3, 4, 5, 6};
int (*ptr)[3] = a;
printf(\"%d %d \", (*ptr)[1], (*ptr)[2]);
++ptr;
printf(\"%d %d\\n\", (*ptr)[1], (*ptr)[2]);
return 0;
}
Question 7
Assume the following C variable declaration
int *A [10], B [10][10];
Of the following expressions
I. A [2] II. A [2][3] III. B [1] IV. B [2][3]
which will not give compile-time errors if used as left hand sides of assignment statements in a C program ?
Question 8
#include<stdio.h>
int x = 5;
int main()
{
int arr[x];
static int x = 0;
x = sizeof(arr);
printf(\"%d\", x<<2);
return 0;
}
Question 9
#include <stdio.h>
#include <string.h>
int main()
{
char a[] = {\'G\',\'E\',\'E\',\'K\',\'S\',\'Q\',\'U\',\'I\',\'Z\'};
char b[] = \"QUIZ\";
char c[] = \"GEEKS\";
char d[] = \"1234\";
int l = strlen(a);
int o = printf(\"%d\", sizeof((sizeof(l)+(c[5]+d[0]+a[1]+b[2]))) );
printf(\"%c\", a[o]);
return 0;
}
Question 10
Consider line number 3 of the following C- program.
int main ( ) { /* Line 1 */
int I, N; /* Line 2 */
fro (I = 0, I < N, I++); /* Line 3 */
}
Identify the compiler\'s response about this line while creating the object-module
There are 25 questions to complete.