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 *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }

1 Answers  


hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?

6 Answers  


Write a program that reads a dynamic array of 40 integers and displays only even integers

2 Answers  


main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }

1 Answers  


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

11 Answers   Google,






What is your nationality?

1 Answers   GoDB Tech,


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; } }

1 Answers  


main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }

1 Answers  


main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user

2 Answers   HCL,


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; } }

2 Answers   CSS, Wipro,


What is the main difference between STRUCTURE and UNION?

13 Answers   HCL,


main() { char *p; int *q; long *r; p=q=r=0; p++; q++; r++; printf("%p...%p...%p",p,q,r); }

1 Answers  


Categories