Answer & Solution
The pointer points to % since it is incremented twice and again decremented by 2, it points to '%d\n' and 300 is printed.
void main()
{
char *p;
p="%d\n";
p++;
p++;
printf(p-2, 300);
}
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;
}
}
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++;
}
}
#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);
}
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);
}
#include<stdio.h>
main()
{
int n;
n=f1(4);
printf("%d",n);
}
f1(int x)
{
int b;
if(x==1)
return 1;
else
b=x*f1(x-1);
return b;
}
#include <stdio.h>
main()
{
if (sizeof(int) > -1)
printf("True");
else
printf("False");
}
(x = foo())!= 1 considering foo() returns 2