C Fundamentals(C Program ) Questions and Answers

Question 1. Who is father of C Language?
  1.    Bjarne Stroustrup
  2.    James A. Gosling
  3.    Dennis Ritchie
  4.    Dr. E.F. Codd
Explanation:-
Answer: Option C. -> Dennis Ritchie

Question 2. C was primarily developed as
  1.    System programming language
  2.    General purpose language
  3.    Data processing language
  4.    None of the above.
Explanation:-
Answer: Option A. -> System programming language

Question 3. C programs are converted into machine language with the help of
  1.    An Editor
  2.    A compiler
  3.    An operating system
  4.    None of these.
Explanation:-
Answer: Option B. -> A compiler
A compiler is a system software that converts high level language into machine level language.

Question 4. C Language developed at _________?
  1.    AT & T's Bell Laboratories of USA in 1972
  2.    AT & T's Bell Laboratories of USA in 1970
  3.    Sun Microsystems in 1973
  4.    Cambridge University in 1972
Explanation:-
Answer: Option A. -> AT & T's Bell Laboratories of USA in 1972

Question 5. For 16-bit compiler allowable range for integer constants is ________?
  1.    -3.4e38 to 3.4e38
  2.    -32767 to 32768
  3.    -32668 to 32667
  4.    -32768 to 32767
Explanation:-
Answer: Option D. -> -32768 to 32767
In a 16 Bit C compiler we have 2 bytes to store an integer, and 1 byte for a character.
For unsigned integers the range is 0 to 65535.
For signed integers the range is -32768 to 32767.
For unsigned character, 0 to 255

Question 6. Standard ANSI C recognizes ______ number of keywords?
  1.    30
  2.    32
  3.    24
  4.    36
  5.    40
Explanation:-
Answer: Option B. -> 32

Question 7. Which one of the following is not a valid identifier?
  1.    _examveda
  2.    1examveda
  3.    exam_veda
  4.    examveda1
Explanation:-
Answer: Option B. -> 1examveda
The first character must be a letter or special symbol underscore( _ ).

Question 8. A C variable cannot start with
  1.    A number
  2.    A special symbol other than underscore
  3.    Both of the above
  4.    An alphabet
Explanation:-
Answer: Option C. -> Both of the above

Question 9. What will be printed after execution of the following program code?
main()
{
printf("\\nab");
printf("\\bsi");
printf("\\rha");
}
  1.    absiha
  2.    asiha
  3.    haasi
  4.    hai
  5.    None of these
Explanation:-
Answer: Option D. -> hai
\\n - newline - printf("\\nab"); - Prints 'ab'
\\b - backspace - printf("\\bsi"); - firstly '\\b' removes 'b' from 'ab ' and then prints 'si'. So after execution of printf("\\bsi"); it is 'asi'.
\\r - linefeed - printf("\\rha"); - Now here '\\r' moves the cursor to the start of the current line and then override 'asi' to 'hai' .

Question 10. Which one of the following is not a reserved keyword for C?
  1.    auto
  2.    case
  3.    main
  4.    default
  5.    register
Explanation:-
Answer: Option C. -> main