General Knowledge :: Testing New
-
Determine Output:
void main()
{
int i=5;
printf("%d%d%d%d%d", i++, i--, ++i, --i, i);
}
-
Determine Output:
#define square(x) x*x
void main()
{
int i;
i = 64/square(4);
printf("%d", i);
}
-
Determine Output:
void main()
{
char *p="hi friends", *p1;
p1=p;
while(*p!='\0') ++*p++;
printf("%s", p1);
}
-
Determine Output:
#include<stdio.h>
#define a 10
void main()
{
#define a 50
printf("%d", a);
}
-
Determine Output:
#define clrscr() 100
void main()
{
clrscr();
printf("%d", clrscr());
}
-
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;
}
}