CSI Chap3 C++ QB
CSI Chap3 C++ QB
Subjective Questiions
1) How the array is initialized in C++? Explain it.
2) Explain the recursive function in C++.
3) What is array? How the elements are input in an array?
4) State the C++ statements for the following.
1) Array of 10 doubles 2) Pointer to an integer
5) What is function overloading? Explain it with example.
6) Explain the inline function with example.
7) What is array? Explain it with example.
8) Explain the inline function with example.
9) State the types of arrays. Explain it with example.
10) Explain the following terms. ------1) Pointer Variable 2) Default Arguments
11) State the difference between normal function and inline function.
12) What is recursive function in C++? State its features.
TG
13) How the array can be defined in terms of pointer? Explain it.
14) Explain the use of continue statement in C++.
S_
15) What is array? Explain the multidimensional array in that.
16) What is function? Explain the advantages of using function in the program.
_C
17) Explain the difference between pass by value and pass by reference method of calling functions.
18) Explain the difference between while and do..while loop in C++.
N
19) Explain the if….else statement in C++.
AO
20) Explain the switch …case statement in C++ with example.
21) Explain the for loop in C++ with example.
G
22) Explain the arithmetical operators used in C++.
BE
30) Write a program in C++ to input and display the two dimensional array. (Consider 2 X 2 matrix)
31) Write a program in C++ to calculate the factorial of a number using recursive function
G
32) Write a program in C++ to calculate the sum of the elements of an array.
H
35) Write a program in C++ to input & display the elements of an array.
SI
36) Write a program in C++ to calculate the area of circle & rectangle using overloading of functions.
37) Write a program in C++ for the following output.
*
**
***
****
*****
38) Write a program in C++ to check whether the given number is odd or even.
39) Write a program in C++ to check whether the given is divisible by 9.
40) Write a program in C++ to calculate and display the sum of first 10 numbers.
41) Write a program in C++ to check whether the given number is prime or not prime.
42) Write a program in C++ to calculate the factorial of given number using function.
43) Write a program in C++ to calculate the area of the circle and display the same.
44) Write a program in C++ to display the maximum number between two numbers.
45) Write a program in C++ to calculate the product of 2 numbers using function.
46) Write a program in C++ to find the maximum number between 2 numbers.
47) Write a program in C++ to display the even numbers from 1 to 100.
48) Write a program in C++ to calculate the area of triangle and display the same.
49) Write a program in C++ to find the sum and average of 10 numbers and display the same
50) Write a program in C++ to calculate and display the cube of a number from 10 to 20.
51) Write a program in C++ to display the table of a number inputted by the user.
52) Write a declaration for each of the following.
1) A pointer to an array of 8 floats 2) A function that returns a float 3) An array of 8 pointers to float.
53) Write a program in C++ to input and display the two dimensional array.(Consider 3X4 array).
Objective Questions
1) ------------- operator is used display the contents of any variable through pointer.
a) & b) * c) ! d) %
TG
3) -------------- function is known as circular function in C++.
a) Inline b) Recursive c) Overload d) Constructor
S_
4) The character type variable in C++ requires --------- bytes.
_C
a) 1 b) 2 c) 3 d) 4
N
5) --------------- is a derived data type in C++.
a) double b)integer c) array d)float
AO
G
6) ------ is the unary operator in C++.
BE
a) + (add) b) ++ c) % d) /
M
19) Which function does insert the function's code directly into the calling programs? ---------
a) main b)void c)inline d)online
20) The scope of any variable used in the entire program is ........
a) Function b) Class c)File d)Local
TG
21) -------- are the building blocks of C++ programs.
a) for b)switch c)if-else d)functions
S_
22) The function that return no value is declared as-------------.
_C
a) void b)public c)null d)static
N
23) A function can be invoked from another function using its .........
AO
a) name b)return c)value d)variables
G
24) C++ was developed by .........
a) Thomas Kushz b) . John Kemney c) James Goling d) Bjarne Stroutstrup
BE
25) If the value of a = 4 and b = 7, then the value of p after execution of statement
M
a) 10 b) 11 c) 9 d) 12
R
27) float * p
G
In above declaration data type of p is --------- and data type of variable pointed
H
by p is -------------.
N
28) When a function is called by reference it can work on ------------ variables in the calling program.
a) original b) virtual c) copies of d) None of these
30) To use string function such as strcmp( ) we must include file ---------------
a) #include<string.h> b) #include<iostream.h> c) #include<fstream.h> d)
#include<iostring.h>
33) The code written for the function is known as function -----------
a) definition b) statement c) argument d) source.
35) ------------- operator is used to store the address of variable in pointer variable.
a) & b) * c) ! d) %
37) When a function is called by value it can work on ------------ variables in the
calling program.
a) Original b) Virtual c) Copies of d) None of these
TG
38) ------------- is used to continue the next iteration of the loop.
a) break b) continue c) goto d) None of these
S_
39) String in C++ are treated as ------------------.
_C
a) integer array b) float array c) character array d) None of these
N
40) -------------- variable is the alias for the variable to which it is assigned.
AO
a) pointer b) reference c) character d) None of theseG
41) In context with the pointers -------------- is the de-reference operator.
a) & b) * c) ! d) %
BE
a) & b) * c) ! d) %
_J
AD
44) ------------ operator resolves the ambiguity between global and local variables.
a) - b) :: c) ! d) %
G
H