C++ Programming :: Basic Concepts

NA
SHSTTON
8
Solv. Corr.
2
Solv. In. Corr.
10
Attempted
0 M:0 S
Avg. Time

1 / 27

Choose the correct option.

The C++ operator used to allocate memory is


Amem

Ballocate

Cnew

Dcreate.

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
7
Solv. Corr.
8
Solv. In. Corr.
15
Attempted
0 M:0 S
Avg. Time

2 / 27

Choose the correct option.

Which is not the feature of structured programming?


ASupport for modular programming

BUser-defined data types

CEmphasis on algorithm

DData abstraction

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
10
Solv. Corr.
5
Solv. In. Corr.
15
Attempted
0 M:0 S
Avg. Time

3 / 27

Choose the correct option.

The "return 0;" statement in main function indicates


AThe program did nothing; completed 0 tasks

BThe program worked as expected without any errors during its execution

Cnot to end the program yet.

DNone of above

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
12
Solv. Corr.
5
Solv. In. Corr.
17
Attempted
0 M:0 S
Avg. Time

4 / 27

Find out the error in following block of code.
If (x = 100)
    Cout << "x is 100";

A100 should be enclosed in quotations

BThere is no semicolon at the end of first line

CEquals to operator mistake

DVariable x should not be inside quotation

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
10
Solv. Corr.
5
Solv. In. Corr.
15
Attempted
0 M:0 S
Avg. Time

5 / 27

Choose the correct option.

Looping in a program means


AJumping to the specified branch of program

BRepeat the specified lines of code

CBoth of above

DNone of above

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
6
Solv. Corr.
9
Solv. In. Corr.
15
Attempted
0 M:0 S
Avg. Time

6 / 27

Choose the correct option.

Which of the following is not a jump statement in C++?


Abreak

Bgoto

Cexit

Dswitch

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
9
Solv. Corr.
6
Solv. In. Corr.
15
Attempted
0 M:0 S
Avg. Time

7 / 27

Choose the correct option.

Which of the following is selection statement in C++?


Abreak

Bgoto

Cexit

Dswitch

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
8
Solv. Corr.
5
Solv. In. Corr.
13
Attempted
0 M:0 S
Avg. Time

8 / 27

What is the output of the below C++ program.
#include<iostream.h>
void main()
{
int n=1;
cout<<endl<<"The numbers are;"<<endl;
do
{
cout <<n<<"\t";
n++;
} while (n<=100);
cout << endl;
 }

APrint natural numbers 0 to 99

BPrint natural numbers 1 to 99

CPrint natural numbers 0 to 100

DPrint natural numbers 1 to 100

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
4
Solv. Corr.
9
Solv. In. Corr.
13
Attempted
0 M:0 S
Avg. Time

9 / 27

Choose the correct option.

Because the lifetime of a local variable is limited and determined automatically, these variables are also called ____________


Aautomator

Bautomatic

Cdynamic

Dstatic

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
8
Solv. Corr.
6
Solv. In. Corr.
14
Attempted
0 M:0 S
Avg. Time

10 / 27

Choose the correct option.

Which of the following is false for switch statement in C++?


AIt uses labels instead of blocks

Bwe need to put break statement at the end of the group of statement of a condition

Cwe can put range for case such as case 1..3

DNone of above

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace