0% found this document useful (0 votes)
47 views7 pages

Select One: A. 4 B. 3 C. Vom Obţine Un Mesaj de Eroare D. 2 E. 0

The document contains multiple choice questions about C++ input/output stream operators and formatting. It tests knowledge of stream modifiers like setw(), setprecision(), and setbase() for formatting output, and the extraction operator >> for reading input. The final question is about the insertion operator << used to output text to the console.

Uploaded by

Luca Dorina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views7 pages

Select One: A. 4 B. 3 C. Vom Obţine Un Mesaj de Eroare D. 2 E. 0

The document contains multiple choice questions about C++ input/output stream operators and formatting. It tests knowledge of stream modifiers like setw(), setprecision(), and setbase() for formatting output, and the extraction operator >> for reading input. The final question is about the insertion operator << used to output text to the console.

Uploaded by

Luca Dorina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

cout << setw(1) << 32767 << setw(4) << 32767 << setw(7) << 32767 <<

setw(10) << 32767;


Cte numere egale vom obine pe ecran?
Select one:
a. 4
b. 3
c. Vom obine un mesaj de eroare
d. 2
e. 0

cout << "C++ are clase!" << '\n' << "C++ are clase!"<< "\n" << "C++ are clase!" <<
endl;
Pe cte linii vom obine acelai mesaj ?
Select one:
a. Vom obine un mesaj de eroare
b. 0
c. 2
d. 3

Care modificator definete modul de aliniere pentru valorile extrase cu cout ?


Select one:
a. setprecision()
b. setw()
c. setf()
d. setfill()
e. setbase()

char s[5], c[3];


cin >> s >> c;
cout << s << c;
La intrare avem: Limbajul C++
Ce extrage ?
Select one:
a. eroare la compilare
b. Limbajul
c. imprevizibi
d. LimbajulC++
e. Limbajul C++

int s = 2; double c = 3;
Ce valoare are sizeof( 2 < 3 ? s : c ) ?
Select one:
a. 4
b. eroare
c. sizeof(int)
d. 1
e. 3
f. 8
g. 2

int x; cin >> x;


Cum se numete aici operatorul ">>" ?
Select one:
a. Operator de extragere
b. Operator de inserare
c. Deplasare de bii la dreapta

int s = 10, c = 20;


cout << setbase(8) << s << ' ' << dec << c;
Ce extrage ?

Select one:
a. 24 10
b. 20 12
c. 12 20
d. 10 20
e. eroare
f. 20 10

cout << dec << 12 << oct << 12 << hex << 12;
Ce va afia?
Select one:
a. 1214c
b. 121212

c. 101214

char msg[15];
cin >> msg;
cout << msg;
La intrare avem mesajul "Hello!C++!"
Ce va afia?
Select one:
a. Hello!
b. Nimic
c. Hello!C++!
d. C++!

#define SQR(x) x*x


Ce valoare are 225/SQR(15) ?
Select one:
a. 1
b. 15
c. nici una din cele indicate
d. 225

cout << "Hello, C++!";


Cum se numete aici operatorul "<<" ?
Select one:
a. Operator de inserare

b. Deplasare de bii la stnga


c. Operator de extragere

int s = 3, c = 4;
cout << setprecision(1) << double(s)/c;
Ce extrage ?
Select one:
a. 0.8
b. eroare
c. 0.75

int s = 10, c = 20;


cout << setbase(8) << s << ' ' << c;
Ce extrage ?
Select one:
a. eroare
b. 20 10
c. 12 24
d. 10 20
e. 24 12

int s = 2 > 1 << 2;


cout << s;
Ce extrage ?

Select one:

a. 0
b. 4
c. 1
d. eroare

Fie sizeof(int) este 2 i


cout << 32323 + 23232;
Ce extrage ?

Select one:
a. eroare la compilare
b. imprevizibil
c. un rezultat greit
d. 55555

Care modificator definete numrul de semne zecimale pentru valorile flotante extase cu cout ?
Select one:
a. setfill()
b. setw()
c. setbase()
d. setprecision()
e. setf()

La intrare avem: C++ is fine!


Ce obinem la ieire ?
char s[22]; cin >> s; cout << s;

Select one:
a. ++
b. C++
c. imprevizibil
d. eroare la compilare
e. C++ is fine!

Care modificator definete limea cmpului de extragere a datelor cu cout ?


Select one:
a. setw()
b. setbase()
c. setfill()
d. setprecision()
e. setf()

Fie sizeof(int) este 4 i


cout << 32323 + 23232;
Ce extrage ?
Select one:
a. un rezultat greit
b. imprevizibil
c. eroare la compilare
d. 55555

You might also like