C Fundamentals Page-3
1. C language was invented to develop which Operating System.?
a) Android
b) Linux
c) Unix
d) Windows
Answer: C
Explanation: C was invented to develop Unix Operating System to overcome compatibility with different Hardware Platforms.
2. C language was invented in the year.?
a) 1972
b) 1973
c) 1972
d) 1990
Answer: A
Explanation: No explanation is given for this question.
3. For 16-bit compiler allowable range for integer constants is ________?
a) -32768 to 32767
b) 3.4e38 to 3.4e38
c) -32767 to 32768
d) -32668 to 32667
Answer: A
Explanation: 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
4. C programs are converted into machine language with the help of
a) A compiler
b) An operating system
c) An operating system
d) None of these.
Answer: B
A compiler is a system software that converts high level language into machine level language.
5. C language is used in the development of .?
a) Databases
b) Graphic applications
c) Word Processors
d) All of the these.
Answer: A
Explanation: C language is very efficient in using hardware resources.
6. Standard ANSI C recognizes ______ number of keywords?
a) 32
b) 36
c) 30
d) 40
Answer: A
No explanation is given for this question
7. Which one of the following is not a reserved keyword for C?
a) auto
b) case
c) main
d) default
Answer: C
No explanation is given for this question
8. A C variable cannot start with
a) A number
b) A special symbol other than underscore
c) Both a & b
d) An alphabet
Answer: C
No explanation is given for this question
9. Which one of the following is not a valid identifier?
a) _algbly
b) 1algbly
c) alg_bly
d) algbly1
Answer: B
The first character must be a letter or special symbol underscore( _ ).
10. What will be printed after execution of the following program code?
main()
{
printf("\\nal");
printf("\\bgb");
printf("\\rly");
}
a) algbly
b) 1agbly
c) lyagb
d) None of these
Answer: D
\\n - newline - printf("\\nal"); - Prints 'al'
\\b - backspace - printf("\\bgb"); - firstly '\\b' removes 'l' from 'al ' and then prints 'gb'. So after execution of printf("\\bgb"); it is 'agb'.
\\r - linefeed - printf("\\rly"); - Now here '\\r' moves the cursor to the start of the current line and then override 'agb' to 'lyb' .