main()

{

char *p;

p="%d\n";

p++;

p++;

printf(p-2,300);

}



main() { char *p; p="%d\n"; p++; ..

Answer / susie

Answer :

300

Explanation:

The pointer points to % since it is incremented twice and
again decremented by 2, it points to '%d\n' and 300 is printed.

Is This Answer Correct ?    8 Yes 1 No

Post New Answer

More C Code Interview Questions

struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }

1 Answers  


Cluster head selection in Wireless Sensor Network using C programming language.

0 Answers  


How do you create a really large matrix (i.e. 3500x3500) in C without having the program crash? I can only reach up to 2500. It must have something to do with lack of memory. Please help!

1 Answers  


#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }

1 Answers  


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 Answers  






Sorting entire link list using selection sort and insertion sort and calculating their time complexity

1 Answers   Infosys, Microsoft, NetApp,


#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

1 Answers  


main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }

2 Answers  


main() { extern int i; i=20; printf("%d",i); }

1 Answers   Value Labs,


int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p

2 Answers  


char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }

2 Answers  


write the function. if all the character in string B appear in string A, return true, otherwise return false.

11 Answers   Google,


Categories