Quiznetik
C Language | Set 2
1. What error will be generated on using incorrect specifier for the datatype being read?
A. compile error
B. run-time error
C. logical error
D. no error
Correct : B. run-time error
2. What is the prototype of scanf function?
A. scanf("controlstring",arg1,arg2,arg3,….,argn);
B. scanf("control string", variable list);
C. scanf(" varible list,", control string);
D. scanf("arg1,arg2,arg3,….,argn", control string);
Correct : A. scanf("controlstring",arg1,arg2,arg3,….,argn);
3. What is the meaning of the following C statement? scanf("%[^\n]s", ch);
A. read all character except new line
B. read all characters
C. read only new line character
D. syntax error
Correct : A. read all character except new line
4. What is the qualifying input for the type specifier G?
A. floating point numbers
B. floating point numbers in exponential format
C. floating point numbers in the shorter of exponential format
D. not a type specifier
Correct : C. floating point numbers in the shorter of exponential format
5. scanf() is a predefined function in______header file.
A. stdlib. h
B. ctype. h
C. stdio. h
D. stdarg. h
Correct : C. stdio. h
6. What does the C statement given below says? scanf("%7s",ch);
A. read string with minimum 7 characters.
B. read string with maximum 7 characters
C. read string exactly to 7 characters
D. read string with any number of characters
Correct : B. read string with maximum 7 characters