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 i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }

1 Answers  


Write a program to receive an integer and find its octal equivalent?

7 Answers  


‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }

2 Answers  


String copy logic in one line.

11 Answers   Microsoft, NetApp,


how to check whether a linked list is circular.

11 Answers   Microsoft,






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  


Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);

1 Answers  


main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }

2 Answers  


What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }

1 Answers  


main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }

1 Answers  


how to swap 3 nos without using temporary variable

4 Answers   Satyam,


main() { clrscr(); } clrscr();

2 Answers  


Categories