General Knowledge :: Testing New
-
Determine Output:
void main()
{
char *p;
p="%dn";
p++;
p++;
printf(p-2, 300);
}
-
Determine Output:
void main()
{
int c[] = {2.8,3.4,4,6.7,5};
int j, *p=c, *q=c;
for(j=0;j<5;j++){
printf(" %d ", *c);
++q;
}
for(j=0;j<5;j++){
printf(" %d ", *p);
++p;
}
}
-
Determine Output:
void main()
{
int a[] = {10,20,30,40,50}, j, *p;
for(j=0; j<5; j++){
printf("%d" ,*a);
a++;
}
p = a;
for(j=0; j<5; j++){
printf("%d" ,*p);
p++;
}
}
-
Determine Output:
#include<stdio.h>
void main()
{
char s[]={'a','b','c','n','c','\0'};
char *p, *str, *str1;
p=&s[3];
str=p;
str1=s;
printf("%c", ++*p + ++*str1-32);
}
-
Determine Output:
void main()
{
static char *s[] = {"black", "white", "yellow", "violet"};
char **ptr[] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
++p;
printf("%s",*--*++p + 3);
}
-
Determine output:
void main()
{
int const *p=5;
printf("%d", ++(*p));
}
-
Determine Output:
void main()
{
char s[]="man";
int i;
for(i=0; s[i]; i++)
printf("%c%c%c%c ", s[i], *(s+i), *(i+s), i[s]);
}
-
Determine Output:
void main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I hate Examveda");
else
printf("I love Examveda");
}
-
Determine Output:
void main()
{
static int var = 5;
printf("%d ", var--);
if(var)
main();
}
-
Determine output:
void main()
{
int const *p=5;
printf("%d", ++(*p));
}