Log In Register

Units


Formatted Input - Questions and Answers

 

Practice these Formatted Input  under C Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Formatted Input for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Formatted Input of C Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge C Programming specifically Formatted Input .
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Formatted Input under C Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Formatted Input topic of C Programming:

 

1.

int sscanf(char *string, char *format, arg1, arg2, …)

Answer: Option A

Explanation:

2.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         int n;
  5.         scanf("%d", n);
  6.         printf("%d\n", n);
  7.         return 0;
  8.     }

Answer: Option C

Explanation:

3.

scanf returns as its value

Answer: Option D

Explanation:

4.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         short int i;
  5.         scanf("%hd", &i);
  6.         printf("%hd", i);
  7.         return 0;
  8.     }

Answer: Option A

Explanation:

5.

Which of the following is an invalid method for input?

Answer: Option D

Explanation:

6.

Which of the following is NOT a delimiter for an input in scanf?

Answer: Option D

Explanation:

7.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         short int i;
  5.         scanf("%*hd", &i);
  6.         printf("%hd", i);
  7.         return 0;
  8.     }

Answer: Option D

Explanation:

8.

Which of the following represents the function for scanf?

Answer: Option C

Explanation:

9.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         char n[] = "hellonworld!";
  5.         char s[13];
  6.         sscanf(n, "%s", s);
  7.         printf("%s\n", s);
  8.         return 0;
  9.     }

Answer: Option B

Explanation:

10.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         char *n;
  5.         scanf("%s", n);
  6.         return 0;
  7.     }

Answer: Option A

Explanation:

11.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         short int i;
  5.         scanf("%h*d", &i);
  6.         printf("%hd", i);
  7.         return 0;
  8.     }

Answer: Option D

Explanation:

12.

The conversion characters d, i, o, u, and x may be preceded by h in scanf to indicate

Answer: Option D

Explanation:

13.

If the conversion characters of int d, i, o, u and x are preceded by h, it indicates?

Answer: Option C

Explanation:

14.

Which of the following doesn’t require an & for the input in scanf?

Answer: Option C

Explanation:

15.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         int n;
  5.         scanf("%d", n);
  6.         printf("%d", n);
  7.     }

Answer: Option B

Explanation: