Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C++Day1

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

Which of the following commands is used to input data from the user?

أي من الاوامر التالية يستخدم لإدخال البيانات من المستخدم؟

a)

cout<<variable ;

b)

input( variable ) ;

c)

cin << variable ;

d)

cin >> variable ;

2.

What does the word (endl) do?
endl في جملة الطباعة ماوظيفة الكلمة

a)

Screen wipe
مسح الشاشة

b)

Variable definition
تعريف المتغير

c)

End the current line and clear the buffer
إنهاء السطر الحالي وتفريغ الذاكرة المؤقتة

d)

Exit the program
إنهاء البرنامج بالكامل

3.

أي مما العبارات التالية تستخدم لطباعة Hello متبوعة بقيمة المتغير x
Which of the following statements is used to print Hello followed by the value of the variable x?

a)

cout<<"Hello "<< x ;

b)

cout<<"Hello "<<"x";

c)

cout<<"Hello >> x;

d)

cout<<"Hello x";

4.

Which symbol is used to write a single-line comment
أي رمز يستخدم لكتابة تعليق من سطر واحد

a)

<<

b)

//

c)

/*

d)

--

5.

أي مكتبة يجب تضمينها لاستخدام cin , cout
Which library should be included to use cin, cout

a)

iostream

b)

iomanip

c)

math

d)

string

6.

Which of the following lines defines a variable and assigns a value to it at the same time?
أي من الاسطر التالية يقوم بتعريف متغير وتخصيص قيمة له في نفس الوقت

a)

int score; = 100

b)

int score = 100;

c)

score = 100

d)

int score

7.

Which of the following commands is defining a character variable?
أي الاوامر التالية سليم برمجيا لتعريف متغير حرفي

a)

char g = "A";

b)

char g = 'A' ;

c)

character g = 'A';

d)

g = 'A';

8.

If you need to store the world's population, which is around 8 billion, which data type is most suitable?
اذا كنت بحاجة لتخزين عدد سكان العالم حوالي 8 مليار , أي نوع بيانات هو الانسب

a)

int

b)

char

c)

double

d)

long long

9.

Which of the following variable names is correct
أي من أسماء المتغيرات التالية صحيح

a)

_score

b)

9score

c)

score&ML

d)

score ball