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

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,


main() { int c=- -2; printf("c=%d",c); }

1 Answers   TCS,


write a c-program to find gcd using recursive functions

5 Answers   HTC, Infotech,


In the following pgm add a stmt in the function fun such that the address of 'a' gets stored in 'j'. main(){ int * j; void fun(int **); fun(&j); } void fun(int **k) { int a =0; /* add a stmt here*/ }

1 Answers  


pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"

2 Answers  






how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

0 Answers  


Finding a number multiplication of 8 with out using arithmetic operator

8 Answers   Eyeball, NetApp,


main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }

1 Answers  


write a c program to print magic square of order n when n>3 and n is odd?

1 Answers   HCL,


void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }

1 Answers  


main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }

6 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,


Categories