hello there i have a c++ test in two weeks
i'v got this sample test if u could just help me with the answers i'll be very thankfull


1) Algorithm can be defined as _________________. (Choose one)) [1]

a) A logical and concise list of steps required to solve a problem.
b) A sequence of diagrams required to solve a problem.
c) A concise list of steps required to solve a problem.

2) _________ is the process of following one of two or more alternate paths of computations. (Choose one) [1.5]

a) Branching. c) Loops
b) Instructions. d) Algorithms.

3) A program requires all the variables to be declared before they are used. (Choose one) [0.5]
a) True. b) False.

4) Which one of the following loop is ideally used when we know how many times the loop will be executed ? [1]
a) For. c) Repeat...until.
b) While.

5) void main ()
The above line of the program indicates the _____________ of a program. (Choose one) [1]
a) Stop. c) Start.
b) End. d) Break

6) What will be the output of the following code segment? (Choose one)
for(i=1; i<3; i++)
{
for(j=1; j<3; j++)
{
printf(“%d ”, i*j);
}
} [2]
a) 1 1 1 2. c) 1 2 2 4.
b) 1 2 2 3. d) 1 2 2 2.

7) ______ statements can change the flow of program. (Choose one) [1]
a) Logical. c) Unconditional.
b) Conditional. d) Mathematical.

8) For calculating the average marks for 100 students, the step that calculates the average for one student has to be repeated _______ times, if the loop starts with a value of 0. (Choose one) [1]
a) 99. c) 101.
b) 10. d) 100.

9) void main( )
{
putchar(‘z’);
putchar(70);
}
What is the output of the above code? (Choose one) [1.5]
a) zF. c) 90F.
b) z70. d) 9070.

10) void main( )
{
putchar ( 'n' );
}
What is the output of the above code? (Choose one) [1]
a)N b)’n’
c)’N’ c)n

11) After accepting a character, the ________ function waits for the Enter key to be pressed. (Choose one) [1]
a) getch(). c) putchar().
b) getchar(). d) putch().

12) In a while loop, the condition is tested only after the body of the loop is executed at least once. [0.5]
a) True. b) False.

13) What will be the output of the following expression? (Choose one)
i =10;
if(i> 5 * 4)
printf(“%d”, i) [1]
a) None. c) 10.
b) 1. d) 20.

14) The following expression will evaluate to _____________. (Choose one)
(5+9*3^2-4 > 10) AND (2+2^4-8/4 > 6) OR (3<6 AND 10 >11)) [2]
a) 4. c) 6.
b) True. d) False.

15) If the first condition is false and the second condition is true, the result of the AND operator will be ______. (Choose one) [0.5]
a) True. b) False.

16) The result of which arithmetic operator will return 81 (Choose one)
[1]
a) 9+2. c) 9^2.
b) 9/2. d) 9*2.

17) What will be the output of the following code? (Choose one)
int j;
for(j=1; j<10; j+=2)
printf(“%d ”,j); [1]
a) 1 2 3 4 5 6 7 8 9. c) 1 3 5 7 9.
b) 2 4 6 8. d) 1 2 4 6 8.

18) What will be the value of *x? (Choose one)
int a =20,b=50;
int *x;
x=&a;
x=&b; [1]
a) 20. c) a.
b) 50. d) b.

19) The index of an array starts at one. (Choose one) [0.5]
a) True. b) False .

20) The address operator is shown using the ________symbol (Choose one) [1.0]
a) *. c) &.
b) #. d) @.

21) A value of 20 is to be assigned to the third element of an array. Which is the right method? (Choose one)
a) Num[3]=20. c) Num[4]=20.
b) Num[2]=20. d) [4]num=20.

22) Identify the statement that produces the following output. (Choose one)
1
22
333
4444
55555 [2.0]
a) for(a = 1; a <= 5; a = a + 1)
{
for( b = 1; b <= 5; b = b + 1)
printf("%d", b);
printf("\n");
}
b) for( a = 1; a <= 5; a = a + 1)
{
for( b = 1; b <= a; b = b + 1)
printf("%d", a);
printf("\n");
}
c) for( a = 1; a <= 5; a = a + 1)
{
for( b = a; b <= 5; b = b + 1)
printf("%d", b);
printf("\n");
}
d) for( a = 1; a <= 5; a = a + 1)
{
for( b = 1; b < a; b = b + a)
printf("%d", b);
printf("\n");
}

23) A file pointer is essential for reading or writing files. (Choose one) [0.5]
a) True. b) False .

24) Fp=fopen(“c:\jak.txt”,”W”) in this Statement “W” Stands for ? (Choose one) [2.0]
a) Open a text file for reading c) Create a text file for writing
b) Append to a text file d) None.

25) The function feof() returns true if the end of the file has been reached, otherwise it returns false (0). (Choose one) [1.0]
a) True. b) False .