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

#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


Write a program to model an exploding firecracker in the xy plane using a particle system

0 Answers   HCL,


int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too

1 Answers  


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

0 Answers   Home,


main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16

4 Answers   HCL,






void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }

1 Answers   Honeywell,


source code for delete data in array for c

1 Answers   TCS,


There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }

1 Answers  


Program to find the largest sum of contiguous integers in the array. O(n)

11 Answers  


Is it possible to type a name in command line without ant quotes?

1 Answers   Excel, Infosys,


Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.

2 Answers   Mentor Graphics, Microsoft,


plz send me all data structure related programs

2 Answers  


Categories