11 Objective type interview questions on C/C++ with answers – Part 6
Before you start:-
- You can check your answer by filling a,b,c,d or e in the text box.
- You can get the answer by clicking Give Up Button.
Give your best shot before giving up 🙂
Q1) Max value of SIGNED int?
a. 2^31
b. 2^31 -1
c. 2^32
d. 2^32 -1
Q2) What does extern means in a function declaration?
a. the funct has global scope
b. the funct need not be defined
c. nothing really
d. the funct has local scope only to the file it is defined in
e. none of the above
Q3) When does a stack member will be initialized?
a. when object is created
b. when object is initialised.
c. does not depend on object.
d. none.
Q4) What will it print?
int i=5 printf("%f",i);
a. 5.000000
b. 0.000000
c. 5
d. 0
Q5) What’s wrong with the program?
struct s{ char a; int t; } /* comment */ main() {int x=3; return;}
a. main is not returning int
b. main is not returning struct
c. main is is not marked public
d. no name is given to struct.
a. +
b. ++
c. *
d. .
Q7) What is the size of the stack ?
fact(int x) { int n; n=x; return fact(x-1); }
a. infinity
b. n
c. n*(n-1)
d. depends on compiler and processor used.
a. compile-time
b. run-time
c. link-time
d. load-time
Q9) What is true for volatile?
a. code for each assignment of a volatile variable must be generated even if it appears to have no effect
b.a variable cannot be both constant and volatile
c.volatile type specifier can be used alone
d.volatile type specifier can be used to provide reliable access to specified memory location
Q10) What will be the value of a & b after the execution of below program?
int a=5,b=6 swap(&a,b);
This function is written to swap a and b
find value of a and b.
a. 5,6
b. 6,5
c. 5,5
d. 6,6
Q11) In C which parameter passing technique is used?
a. call by value,
b. call by reference,
c. both