C++ Quiz 1

Descrição

control io, namespaces & data types.
Oscar Rojas
Quiz por Oscar Rojas, atualizado more than 1 year ago
Oscar Rojas
Criado por Oscar Rojas mais de 4 anos atrás
1
0

Resumo de Recurso

Questão 1

Questão
Check all that are valid declarations:
Responda
  • long n = 100;
  • int a = 25
  • double {0.07};
  • unsigned __int16 = -69;
  • unsigned long double = 4.444;

Questão 2

Questão
What will the following code return: #include <iostream> int main() { __int16 t = 1400; std::cout << t + sizeof(t); }
Responda
  • 1402
  • 1416
  • 1432

Questão 3

Questão
Which of the following may not be of type void?
Responda
  • Objects
  • Arrays
  • Functions
  • References

Questão 4

Questão
The range of values that a 32 bit int can hold are from [+/- [blank_start]2,147,000,000[blank_end]]
Responda
  • 32,768
  • 1,200,000,000
  • 2,147,000,000
  • 9,000,000,000

Questão 5

Questão
List the Floating Point types from least to greatest: [blank_start]float, long double, double[blank_end]
Responda
  • double, long double, float
  • long double, double, float
  • double, float, long double
  • float, double, long double

Questão 6

Questão
Debug the following code: #include <iostream> #include <string> // Allows use of strings // [blank_start]missing namespaces[blank_end] int main() { std::string n; // [blank_start]Debug[blank_end] int num // [blank_start]Debug[blank_end] std::cout<<"Enter a #"<< std::endl; // [blank_start]Debug[blank_end] std::getline(cin, n); // [blank_start]Debug[blank_end] [blank_start]function[blank_end] >> num; } For lines w/o mistakes return 0
Responda
  • #include <sstream>
  • 0
  • int num;
  • 0
  • std::getline(std::cin, n);
  • std::stringstream n

Semelhante

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr