Search Header Logo

First Quiz

Authored by Nabeel Ahmed

Computers

University

Used 2+ times

First Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for declaring a variable in C++?

a) int x;

b) x = 5;

c) variable x;

d) declare x;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In C++, which stream is used for standard output?

a) cin

b) cout

c) cerr

d) clog

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you read input from the user in C++?

a) input()

b) scan()

c) cin

d) read()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the "if" statement in C++?

a) Looping

b) Decision making

c) Function declaration

d) Variable initialization

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the "else" statement do in C++?

a) Starts a new block of code

b) Defines a function

c) Executes when the "if" condition is false

d) Terminates the program

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is the ternary operator written in C++?

a) ? :

b) &&

c) ||

d) //

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In C++, what is the purpose of nested if-else statements?

a) Increase code readability

b) Perform multiple checks sequentially

c) Avoid syntax errors

d) Improve program performance

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?