main()

{

char name[10],s[12];

scanf(" \"%[^\"]\"",s);

}

How scanf will execute?

Answers were Sorted based on User's Feedback



main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } ..

Answer / susie

Answer :

First it checks for the leading white space and discards
it.Then it matches with a quotation mark and then it reads
all character upto another quotation mark.

Is This Answer Correct ?    6 Yes 2 No

main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } ..

Answer / banoth manjula9

No

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Code Interview Questions

main() { printf("%x",-1<<4); }

3 Answers   HCL, Sokrati, Zoho,


write a program to Insert in a sorted list

4 Answers   Microsoft,


main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }

2 Answers   Wipro,


Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).

1 Answers  


void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }

1 Answers  






Write a c program to search an element in an array using recursion

1 Answers   Wipro,


How to palindrom string in c language?

6 Answers   Google,


main() { char not; not=!2; printf("%d",not); }

1 Answers  


main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

1 Answers   CSC,


could you please send the program code for multiplying sparse matrix in c????

0 Answers  


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256

2 Answers   HCL,


main( ) { void *vp; char ch = ‘g’, *cp = “goofy”; int j = 20; vp = &ch; printf(“%c”, *(char *)vp); vp = &j; printf(“%d”,*(int *)vp); vp = cp; printf(“%s”,(char *)vp + 3); }

1 Answers  


Categories