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

How do you sort a Linked List (singly connected) in O(n) please mail to pawan.10k@gmail.com if u can find an anser...i m desperate to knw...

6 Answers   Microsoft, MSD, Oracle,


#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }

1 Answers  


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

0 Answers  


main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”

5 Answers   HCL,


#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }

0 Answers  






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

2 Answers  


There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.

1 Answers   Nagarro,


how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!

8 Answers   GATE,


main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }

1 Answers   CSC,


write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?

1 Answers  


#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }

1 Answers  


void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }

2 Answers  


Categories