C language MCQs - I

 C language basics 

Why TIOBE Awarded C Programming Language Of The Year 2019?
A. C language has been developed by –
1) Ken Thopson
2) Dennis M. Ritchie
3) Peter Norton
4) Martin Richards
Answer – 2) Dennis M. Ritchie
B. C can be used on –
1) Only MS Dos operating systems
2) Only linux operating systems
3) Only windows operating systems
4) All of the above
Answer – 4) All of the above
C. C programs are converted into machine language with the help of –
1) An editor
2) A compiler
3) An operating system
4) None of the above
Answer – 2) A compiler
D. The real constant in C can be expressed in which of the following –
1) Fractional form only
2) Exponential form only
3) ASCII form only
4) Both fractional and exponential forms
Answer – 4) Both fractional and exponential forms
E. A character variable can at a time store -
1) 1 character
2) 8 character
3) 254 character
4) None of the above
Answer – 1) 1 character
F. The statement char ch = ‘z’ would store in ch –
1) The character z
2) ASCII value of z
3) z along with single inverted commos
4) both (1) and (2)
Answer – 2) ASCII value of z
G. Which of the following is not a character constant –
1) ‘Thank You’
2) ‘Enter values of P,N,R’
3) ’23.56E – 03’
4) All of the above
Answer – 4) All of the above
H. The maximum value that an integer costant can have is –
1) -32767
2) 32767
3) 1.7014e+38
4) -1.7014e+38
Answer – 2) 32767
I. A C variable can not start with –
1) An alphabet
2) A number
3) A special symbol other than underscore
4) Both (2) and (3)
Answer – 4) Both (2) and (3)
J. Which of the following statement is wrong –
1) mes=123.56;
2) con=’T’*’A’;
3) this=’T’*20;
4) 3+a=b;
Answer – 4) 3+a=b;
K. Which of the following shows the correct hierarchy of arithmetic operators in C
1) ** , * or / , + or –
2) ** , * , / , + , -
3) ** , / , * , + , -
4) / or * , - or +
Answer – 4) / or * , - or +
L. In b=6.6/a+2*n; which operation will be performed first –
1) 6.6/a
2) 2*n
3) a+2
4) depends on compiler
Answer – 1)6.6/a
M. Which of following is allowed in a C arithmetic instruction –
1) [ ]
2) { }
3) ( )
4) None of the above
Answer – 3)( )
N. Which of the following statement is false –
1) Each new C instruction has to be written of a separate line
2) Usually all C statements are entered in small case letters
3) Blank spaces may be inserted between two words in a C statement
4) Blank spaces can not be inserted within a variable name
Answer – 1) Each new C instruction has to be written of a separate line
O. If a is an integer variable , a=5/2 ; will return a value –
1) 2.5
2) 3
3) 2
4) 0
Answer – 3) 2
P. The expression , a=7/22*(3.14+2)*3/5 ; evaluates to –
1) 8.28
2) 3.14
3) 6.28
4) 0
Answer – 4) 0
Q. The expression , a=30*1000+2768 ; evaluates to –
1) 32768
2) -32768
3) 113040
4) 0
Answer – 1) 32768
R. The expression , x = 4 + 2 % -8 ; evaluates to –
1) -6
2) 6
3) 4
4) 0
Answer – 2) 6
S. Hierarchy desides which operator –
1) is most important
2) is used first
3) is fastest
4) operates on largest numbers
Answer – 2) is used first
T. An integer constant in C must have –
1) At least one digit
2) At least one decimal point
3) A comma along with digits
4) Digits separated by commos
Answer – 1) At least one point
U. A character variable can never store more then –
1) 32 character
2) 254 character
3) 8 character
4) 1 character
Answer – 4) 1 character
V. In C a variable can not contain –
1) Blank space
2) Decimal point
3) Hyphen
4) All of the above
Answer – 4) All of the above
W. Which of the following is false in C –
1) Keywords can be used as a variable in C
2) Variable name contains a digit
3) Variable name do not contain a blank space
4) Capital names can used in variable names
Answer – 1) Keywords can be used as a variable in C
X. In , C arithmetic instruction can not contain –
1) Variables
2) Constants
3) Variable names on right side of =
4) Constants on left side of =
Answer – 4) Constants on left side of =
Y. Which of the following shows the correct hierarchy of arithmetic operators in C
1) / + * -
2) * - / +
3) + - / *
4) * / + -
Answer – 4) * / + -
Z. What will the value of d if d is a float after the operation d = 2/7.0 ;
1) 0
2) 0.2857
3) Can not determined
4) None of the above
Answer – 2) 0.2857


Download PDF Notes

No comments:

Post a Comment