Search Header Logo

Trắc nghiệm C++

Authored by Duc Nguyen

Computers

University

Used 1+ times

Trắc nghiệm C++
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <iostream>

int main()

{

int a = 10;

cout<<a;

int a = 20;

cout<<a;

return 0;

}

1020

1010

2020

Lỗi: Redeclaration of a

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int x = 10;

int main(){

int x = 0;

cout<<x;

return 0;

}

10

0

compile error

undefined

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int a = 1, b = 1, c;

c = a++ + b;

printf("%d, %d", a, b);

}

a=1, b=1

a=2, b=1

a=1, b=2

a=2, b=2

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Is it possible to run program without main() function?

yes

no

may be

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The output of the following segment is

int k, n=20;

k=(n>5?(n<=10?100:200):500);

printf("%d",n);

100

200

300

20

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

Inside try

Exception Caught

After throw

After catch

Inside try

Exception Caught

After catch

Inside try

Exception Caught

Inside try

After throw

After catch

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

The derived class can not call the base class func().

Must place “using namespace Base” at the top of the file.

Base::d.func();

d.Base::func();

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?