First Quiz

First Quiz

University

30 Qs

quiz-placeholder

Similar activities

VAC - Java -Applets and Servlets

VAC - Java -Applets and Servlets

University

25 Qs

ITSA Selection Round 1

ITSA Selection Round 1

University

27 Qs

PSP Module-1

PSP Module-1

University

25 Qs

C Language Basics

C Language Basics

University

26 Qs

C Programing

C Programing

University

25 Qs

Programming Skills C/C++

Programming Skills C/C++

University

25 Qs

c programming

c programming

University

30 Qs

Code Carnival

Code Carnival

University

25 Qs

First Quiz

First Quiz

Assessment

Quiz

Computers

University

Medium

Created by

Nabeel Ahmed

Used 2+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?