General Knowledge :: Testing New
-
Determine Output:
void main()
{
printf("%p", main);
}
-
Determine Output:
void main()
{
char far *farther, *farthest;
printf("%d..%d", sizeof(farther), sizeof(farthest));
}
-
Determine Output:
void main()
{
char *p;
p="Hello";
printf("%c", *&*p);
}
-
Determine Output:
void main()
{
int i=1;
while(i<=5)
{
printf("%d", i);
if(i>2)
goto here;
i++;
}
}
fun()
{
here: printf("PP");
}
-
Determine Output:
void main()
{
int i=1, j=2;
switch(i)
{
case 1: printf("GOOD"); break;
case j: printf("BAD"); break;
}
}
-
Determine Output:
void main()
{
int i;
printf("%d", scanf("%d", &i)); // value 10 is given as input here
}
-
Determine Output:
void main()
{
int i=0;
for(;i++;printf("%d", i));
printf("%d", i);
}
-
Determine Output:
void main()
{
struct xx
{
int x=3;
char name[] = "hello";
};
struct xx *s = malloc(sizeof(struct xx));
printf("%d", s->x);
printf("%s", s->name);
}
-
Determine output:
void main()
{
extern int i;
i=20;
printf("%d", sizeof(i));
}
-
Determine Output:
void main()
{
int i=0, j=0;
if(i && j++)
printf("%d..%d", i++, j);
printf("%d..%d", i, j);
}