Quiz 1 c++

Quiz
•
Computers
•
6th - 8th Grade
•
Medium
Salma Ghoneim
Used 2+ times
FREE Resource
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the following code do?
Reads two numbers from the console
Adds two numbers and prints the result
Multiplies two numbers and prints the result
None of the above
See Answer
View Solution
Answer explanation
Adds two numbers and prints the result The code outputs the result of the addition operation 21 + 40, which is 61.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Identify Correct Syntax
What is the correct syntax for printing the number 5?
print(5);
display(5);
console.log(5);
cout << 5;
Answer explanation
The correct syntax for printing in C++ is "cout << value;".
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Print difference of 10 and 3
How do you print the result of difference between 10 and 3?
cout << 10 - 3;
cout << diff(10 - 3);
diff(10 - 3)
cout << 10 - 3
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Correct Syntax for Header
Identify the correct syntax from the options below.
#include <iostream>;
?include <iostream>;
#include <iostream>
#include <iosteam>;
Answer explanation
The correct syntax is #include <iostream>, we do not use ;
5.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
Print String num
How would you print the string stored in variable named num?
cout << num;
cout << "num";
cout << value(num);
cout << get(num);
Answer explanation
To print the string variable named num, you directly use cout << "variable_name";
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Print 6 divided by 2
How can you print the result of 66 divided by 2?
cout << 6 / 2;
div(6, 2);
cout << div(6, 2) ;
None of the above
7.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
Identify Incorrect Syntax
Identify the incorrect syntax from the given options.
cout << "Hello, World";
cout << 5 + 3 / 2;
cout << "Hello, World';
cout << "5 + 3";
Answer explanation
Text to be printed using "cout" should be enclosed in double quotes.
Similar Resources on Wayground
12 questions
Introduction to Python Programming

Quiz
•
7th - 10th Grade
10 questions
Understanding HTML

Quiz
•
8th Grade
9 questions
Python maths

Quiz
•
6th - 8th Grade
10 questions
Programare cu C++ nivel 0-5

Quiz
•
6th - 8th Grade
8 questions
ПРОГРАММИРОВАНИЕ НА С++ 8 КЛАСС

Quiz
•
7th - 8th Grade
12 questions
Test Cls 7 Sem I

Quiz
•
6th Grade
12 questions
WEBSITE AUTHORING CHECKPOINT

Quiz
•
8th - 9th Grade
10 questions
Coding - Computer Programming

Quiz
•
KG - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
8 questions
Time Management

Quiz
•
6th Grade
15 questions
Acceptable Use Policy (Quiz)

Quiz
•
6th - 8th Grade
25 questions
Career Vs. Job

Quiz
•
6th - 8th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
20 questions
Copyright and Fair Use

Quiz
•
6th - 8th Grade
15 questions
Computer Components Video

Interactive video
•
8th Grade