400 Câu hỏi trắc nghiệm lập trình C/C++ có đáp án (Phần 3)
50 câu hỏi
Maximum number of arguments that a function can take is 12
Yes
No
Usually recursion works slower than loops
Yes
No
In a function two return statements should never occur.
Yes
No
There is a error in the below program. Which statement will you add to remove it
Add prototype: float f(int, float);
Add prototype: float f(a, b);
Add prototype: float f(float a, int b)
Every function must return a value
Yes
No
Which of the following statements are correct about the program?
It prints garbage values infinitely
Runs infinitely without printing anything
Error: main( ) cannot be called inside printf( )
No Error and print nothing
Will the following functions work?
Yes
No
If a function contains two return statements successively, the complier will generate warnings. Yes / No?
Yes
No
Functions can not return a floating point number
Yes
No
What will be the output of the program?
543210
54321
12345
Infinite loop
What will be the output of the program?
4
5
6
Another
Point out a error of the following program
Missing parenthesis in return statement
The function should be defined as int f(int a, int b)
Re-declaration of a
None of above
Point out the error in the program
Error: Prototype declaration
No error
Error: return statement cannot be used with conditional operators
None of above
What will be the output of the program?
6 6
5 6
Complier error
None of above
What will be output of the program?
4, 3, 4, 3
4, 4, 5, 5
3, 4, 3, 4
None of above
Which of the following statements are correct about this function
The function calculates the value of 1 raised to power n
The function calculates the factorial value of an integer
The function calculates the square root of an integer
None of above
Point out the error in the following program
Error: cannot convert ‘void’ to ‘int’
Error:
What will be output when you will execute following c code? Biết kích thước kiểu char : 1 byte, float : 4 byte, int : 4 byte, double : 8 byte, long : 4 byte.
8 4 1
8 2 1
4 4 1
Depend on complier
What will be output when you will execute following c code?
1 4 5
1 4 7
8 4 7
Another
What value gets printed by the program below?
1
0
0.1
What will be output when you will execute following c code?
-6
5
4
Another
What will be output when you will execute following c code?
Avatar
Alien
Error at (*)
Another
What will be output when you will execute following c code?
7
8
9
Another
What is output ?
4
0
1
5
What is output ?
7
6
5
1
What is output ?
0
Error
1
x isn’t defined
What is output ?
0
1
Error Comlier
What is output ?
1 1
1 0
‘x’ undeclared identifier
Output of following code?
1
0
Error
Output of following code?
1
Error
0
Output of following code?
0123456789
0000000000
0101010101
Output of following code?
1
5
20
‘x’ isn’t defined
What is output?
Garbage Garbage Garbage
5 10 15
15 10 5
Run time error
What is output?
c:/tc/bin/rw.c
c: c inw.c
c:cinw.c
w.c in
What is output ?
5
6
0
Complier error
What is output?
135
8
-121
121
What is output?
12480
1248@
12500
12522
What is output?
Hi
Hello
None of above
What is output of program?
i = 0
i = 1
Error
None of these
Which of the declaration is correct?
int length;
char int;
int long;
float double;
What is output of program?
N = 20
N = 10
Error
No Output
What is output of program?
0 0 0
1 2 2
1 1 1
Error
What is output of program?
3
4
Complier Error
3.14
Which of the following operations are INCORRECT?
int i = 35; i = i%5
short int j = 5; j = j;
long int k = 123L; k = k;
float a = 3.14; a = a%3;
Point out a error in the following program
Error: Declaration syntax error v (or) ‘v’: illegal use of type ‘void’
Program terminate abnormally
No error
None of these
In the following program how long will the for loop get executed?
The for loop would not get executed at all
The for loop would get executed only once
The for loop would get executed 5 times
The for loop would get executed infinite times
Point out the error in the following program (if it is compiled with Turbo C complier)
No error
display( ) is not declared
None of these
Which of the following are unary operators in C?
1. !
2. sizeof
3. ~
4. &&
1, 2
1, 3
2, 4
1, 2, 3
In the expression a = b = 5 the order of Assignment is NOT decided by Associativity of operators.
True
False
Which of the following is the correct order if calling functions in the below code?
f1, f2, f3
f3, f2, f1
Order may vary from complier to complier
None of above







