main()

{

char p[ ]="%d\n";

p[1] = 'c';

printf(p,65);

}

Answers were Sorted based on User's Feedback



main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p..

Answer / susie

Answer :

A

Explanation:

Due to the assignment p[1] = ‘c’ the string becomes, “%c\n”.
Since this string becomes the format string for printf and
ASCII value of 65 is ‘A’, the same gets printed.

Is This Answer Correct ?    30 Yes 3 No

main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p..

Answer / hunny kukreja

Answer:
65

Explanation:
As p is having "%d\n",so it has become format string
for printf,so same will get printed.i.e. number 65

Is This Answer Correct ?    4 Yes 11 No

Post New Answer

More C Code Interview Questions

void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }

4 Answers  


main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }

1 Answers  


typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }

1 Answers  


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector

2 Answers  






main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

1 Answers  


writte a c-programm to display smill paces

2 Answers  


how to test pierrot divisor

0 Answers  


struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }

1 Answers  


how can i cast a char type array to an int type array

2 Answers  


write a program to count the number the same (letter/character foreg: 's') in a given sentence.

2 Answers  


Develop a routine to reflect an object about an arbitrarily selected plane

0 Answers  


Categories