C++ and Python Syntax MCQs

C++ and Python Syntax MCQs

12th Grade

30 Qs

quiz-placeholder

Similar activities

Python set 1

Python set 1

9th - 12th Grade

26 Qs

PYTHON QUIZ 1

PYTHON QUIZ 1

11th - 12th Grade

25 Qs

Analisis Data (informatika 10)

Analisis Data (informatika 10)

9th - 12th Grade

30 Qs

Unit 5 Quiz  AP CSP

Unit 5 Quiz AP CSP

9th - 12th Grade

30 Qs

Feb 20, 2025 AP CompSci - 1st Period

Feb 20, 2025 AP CompSci - 1st Period

12th Grade - University

25 Qs

Python. Основы языка

Python. Основы языка

9th - 12th Grade

35 Qs

MODEL HSS MULANUR- C++

MODEL HSS MULANUR- C++

11th - 12th Grade

25 Qs

CPP Mid Term SPOT test

CPP Mid Term SPOT test

5th Grade - University

25 Qs

C++ and Python Syntax MCQs

C++ and Python Syntax MCQs

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Joyslin Jenifer

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to declare a variable in C++?

int num;

num = int()

int = num;

num := int

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you print a string in Python?

echo "Hello"

cout << "Hello"

print("Hello")

printf("Hello")

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which line defines a function in Python?

function myFunc():

def myFunc():

func myFunc():

void myFunc()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid comment in C++?

// This is a comment

# This is a comment

-- This is a comment

% This is a comment

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is the correct input method in Python?

cin >> x

x = input()

x = gets()

read(x)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of print(2 + 3 * 2) in Python?

10

12

8

7

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid data type in C++?

int

float

stringy

char

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?