1 To 7th CP
1 To 7th CP
a) Software
b) Signal
c) Procedure
d) Debugger
a) Algorithm
b) Programming
c) Flowchart
d) All
a) One
b) Two
c) Three
d) Multiple
a) Programmer
b) Database designer
c) Network administrator
d) Nana
a) Programming language
Chapter 1 to 6
b) Flowchart
c) Program
d) Algorithm
a) Algorithm diagram
b) Flowchart
d) None
a) Progress
b) Condition
c) Input
d) Output
a) Progress
b) Condition
c) Input
d) Output
a) Input
b) Output
c) Both a and b
d) None
a) Desk checking
Chapter 1 to 6
b) Compiling
c) Debugging
d) Coding
a) Flowchart
b) Coding
c) Desk checking
d) None
12. The set of rules of writing program in any program language is called
a) Syntax
b) Bug
c) Debug
d) None
a) Program enhancement
b) Program identification
c) Program development
d) Program implementation
14. which of the following documents describe various features of the software and their way
it is used.
b) Problem description
c) User manual
d) Algorithm
Chapter 1 to 6
a) Design algorithm
b) Testing program
c) Documentation
d) Program execution
a) The program
b) Source code
c) Linked code
18. Which of the following are part of the documentation process except
a) Best procedure
b) Program algorithm
d) User manual
Chapter 1 to 6
d) All of above
20. A type language in which instruction are written in binary from is called
a) Machine language
b) Assembly language
d) None
a) C language
b) Pascal
c) Machine language
d) DOS
a) Complex
b) Simple
c) Time consuming
d) Both a and c
d) Both a and c
a) Assembly language
b) Pascal
c) BASIC
d) FORTRAN
a) Java
b) Assembly language
c) Pascal
d) C++
a) English words
b) Mnemonic codes
c) OS and 1S
d) Binary digit
27. What is the name of the program that translates assembling source code to machine code
a) Compiler
b) Interpreter
c) Assembler
d) Debugger
28 which one of the following translate source code to object code as a whole
a) Interpreter
b) Compiler
Chapter 1 to 6
c) Assembler
d) Debugger
29 choose the program that translate execute one line of source code at a time
a) Compiler
b) Assembler
c) Interpreter
d) None
a) C++
b) FORTRAN
c) Assembly
d) COBOL
31 which language was originally create for teaching the students how to program
a) C++
b) Cobol
c) Assembly
d) Basic
a) Cobol
b) Assembly
c) C++
d) Basic
a) Microsoft
b) IBM
Chapter 1 to 6
c) Sun system
d) Hewlett
34. A programming language used for the mathematical and Engineering application was
a) Basic
b) FORTRAN
c) Assembly
d) COBOL
3).A memory location with some data that cannot be changed is called:
a) Constant b) Variable c) Named constant d) symbolic constant
66) Given that x is a float variable containing the value of 80.9 and num is an int variable, what
will num contain after execution of the statement;
Num = x+ 2.9;
a) 33.8 b) 84.0 c) 83 d) 83.0
8. which loop the condition comes before the body of the loop?
a) While loop
b) Do-while loop
c) For loop
d) B and C
9. In which loop the condition comes after the body of the loop?
a) While loop
b) Do-while loop
c) For loop
d) B and C
10. Which of the following loop is called counter loop?
a) For
b) While
c) Do-while
d) None
11. This loop is a good choice when you know how many times you want the loop to iterate
in advance of entering the loop?
a) While
b) Do-while
c) For
d) Nested
12. This statement causes a loop to terminate early?
a) Break
b) Terminate
c) Exit
Chapter 1 to 6
d) Both a and b
13. A loop within a loop is called:
a) Nested loop
b) Complex loop
c) Infinite loop
d) None
14. The loop which never ends is called:
a) Infinite loop
b) Running loop
c) Continuous loop
d) Nested loop
15. Which statement is used to move the control to the start of loop body?
a) Continue
b) Break
c) Switch
d) None
16. A special value that marks the end of a list of input date is called:
a) Terminal value
b) Sentinel value
c) Loop control value
d) Input value
17. A for statement contains three expressions: initialization, test, and_______?
a) Null
b) Validation
c) Increment/decrement
d) None
18. In a for statement, this expression is executed only once:
a) Test
b) Validation
c) Initialization
d) None
19. This statement may be used to stop a loop’s current iteration and begin next one:
a) Continue
b) Break
c) Terminate
d) None
20. This means to increase a value by one:
a) Modulus
b) Increment
c) Decrement
d) None
Chapter 1 to 6
21. If you want a user to enter exactly 20 values, which loop would be the best to use?
a) While
b) Do-while
c) For
d) Infinite
22. While loop is also called:
a) Conditional loop
b) Wend loop
c) Counter loop
d) None
23. Semicolon is placed at the end of condition in:
a) While loop
b) Do-while loop
c) For loop
d) All
24. Which is a loop statement?
a) If
b) If-else
c) Switch
d) None
25. With respect to the loop in the following main function, what is missing?
Void main()
{
Int loopCount;
while (loopCount <= 5 )
{
cout<< "𝐻𝑖";
loopCount++;
}
return 0;
}
a) The initialization of the loop control variable
b) The testing of the loop control variable
c) The incrementation of the loop control variable
d) Nothing is missing
26. What is the output of the following code?
Int n=4;
Do
{
n = n*3;
Chapter 1 to 6
}
while(n<= 100 );
a) 108
b) 110
c) 107
d) 100
27. What is the output of the following code?
Int n=8;
for(int i=1; i<=n*3; i++)
n++;
a) Infinite loop
b) 9
c) 12
d) 16
28. What is the output of the following code?
Int n=4;
for(int i=n; i>=0; i--)
n-=i;
a) -6
b) 5
c) -7
d) -5
29. What is the output of the following code?
Int n=4;
While (n <= 20)
If (n%2)
n = n-1;
else
n = n+3;
a) 21
b) 20
c) 19
d) 22
30. What is the output of the following code?
Int x= -1, y= 0;
while(x <= 3)
{
y = y +2;
x = x + 1;
}
cout<< y;
a) 10
Chapter 1 to 6
b) 11
c) 9
d) 8
31. What is the output of the following code?
Int n= 0;
for(int m = 0; m < 10; m++){
n +=m++;
}
Cout << n << end1;
a) 20
b) 21
c) 22
d) 18
32. How many time the following code prints “ OPP Using C++”?
Int count = 0;
While (count < 10)
{
cout<< “OPP Using C++”;
count++;
}
a) 9
b) 10
c) 0
d) 11
33. How many time the following code prints “ OPP Using C++”?
Int count = 0;
While(count++< 10 )
{
cout<< “OPP Using C++”;
}
a) 12
b) 10
c) 9
d) 0
34. How many time the following code prints “ OPP Using C++”?
Int count = 0;
do
{
cout<< “OPP Using C++”;
} while (count++< 10);
a) 11
Chapter 1 to 6
b) 12
c) 9
d) 13
35. What is the value of variable s after the following loop terminates?
Int s = 0;
Int n = 0;
Do
{
n++;
s+= n;
if (s > 4) break;
}
while (n < 5);
a) 6
b) 5
c) -6
d) 0
36. What is the value of variable s after the following loop terminates?
Int s = 0;
Int n = 0;
do
{
n++;
s+= n;
if (s >= 4) continue;
}
while (n < 5);
a) 15
b) 14
c) 16
d) 18
Chapter 1 to 6
MULTIPLE CHOICE
1. Variable that holds a large group of similar type of data is called:
a. Constant
b. Scalar value
c. Array
d. Multiple variable
2. An array:
a. Always begins at index 0
b. Of two dimensions can be accessed in the following form: x [row,col]
c. Is a contiguous allocation of memory made up of elements
The index of first element of an array is always:
d. Both a and c
3. Which of the following statements are true?
a. Every element in an array has the same type
b. The array size is fixed after it is created
c. The array size used to declare an array must be a constant expression
d. All
4. An array with no elements is:
a. Illegal in c++
b. Legal in c++
c. None
5. Which of the following is not a simple data type?
a. Int
b. Array
c. Float
d. Char
6. Each element of array has its own:
a. Array
b. Index
c. Upper bound
d. Lower limit
7. The index of first element of an array is always:
a. 0
b. 2
c. 4
d. 1
8. What is the representation of the third element in an array called n?
a. n[2]
b. n[3]
c. n[1]
d. n[4]
Chapter 1 to 6
9. What is the correct term for n [99]?
a. Array variable
b. Indexed variable
c. Both a and b
10. Each element in array has:
a. Similar index
b. Unique index
c. Both a and b
11. Which of the following declares an array of 10elements and assigns the value 3.2 to the
first element?
a. Float n[9]; n[0]=3.2;
b. Float n[9]; n[1]=3.2;
c. Float numbers [10]; n[0]-3.2;
d. Float n[10]; n[1]=3.2;
12. How many elements are the array?
a. 5
b. 6
c. 4
d. 0
13. Which line of code will declare an array and initialize it?
a. Int a[6] = (4,7,8,2,9,5);
b. Int a [6] (4,7,8,2,9,5);
c. Int a [6] = (4,7,8,2,9,5);
d. Int a [6] (4,7,8,2,9,5);
14. In the statement:
List [4]=3.3;
The value 4 indicates:
a. Size of array
b. Array Element
c. Subscript
d. Variable
15. To access an array element, use the array name and the element’s
a. Name
b. Value
c. Data type
d. Subscript
16. Which of the following is valid C++ array definition?
a. Viod n[5];
b. Int arr[20];
c. Int arr[0];
d. None
17. A two-dimensional array can be viewed as:
Chapter 1 to 6
a. Arguments,parameters
b. Increment,decrement
c. Rows,columns
18. Given the following declaration, where is 77 stored in the n array?
Int n[ ]=[83,62,77,97];
a. N[0]
b. N[1]
c. N[2]
d. N[4]
19. An array can easily be stepped through by using a:
a. Reference variable
b. Null value
c. For loop
d. None
20. What is the output of the following code?
Int main()
{
Int x [5];
Int i;
For (i=0;i<5;i++)
X[1]=i;
Count<<x[i]<<**;
}
a. 0.1234
b. 4
c. 0
d. None
21. Assume int t[] = {1,2,3,4}. What is t[4]?
a. {}
b. 3
c. 4
d. Accessing t[4] may result in runtime error
22. An array that will hold 5 names with 20characters in the name would be declared using
which statement?
a. Char names [5][20];
b. Char names[20][5];
c. Char names[21][5];
d. Char names[5][21];
23. Which of the following statements is valid?
a. Int i[]={3,4,3,2};
b. Int i[4]={3,4,3,2};
c. Double d [30];
d. all
Chapter 1 to 6
24. When an array is sorted from highest to lowest, it tis said to be in:
a. Ascending order
b. Descending order
c. Forward order
d. Reverse order
25. Which of the following is adequate for searching through small arrays?
a. Linear search
b. Binary search
c. Bubble sort
d. None
26. How many elements does the following array have?
Int n[1000];
a. 1000
b. 998
c. 0
d. 999
27. Which of the following correctly declare an array that can hold up to 3 rows of 5 columns
of doubles?
a. Double array [3];[5];
b. Int array [3](int [5]);
c. Double array[3][5];
d. Double array [3,5];
28. What is the output of the following C++ code?
Int n[] {56,90,86,97,120};
Count << n{3} <<endl;
a. 97
b. 98
c. 99
d. 90
29. What is the output of the following C++ code?
Int n[5];
For (int i=1;i<5;i++)
N{I – 1} - I + 1;
For (int I = 0; I < 3;i++)
Count << n[i];
a. 234
b. 240
c. 334
d. 221
Chapter 1 to 6