Oscar Rojas
Quiz by , created more than 1 year ago

control io, namespaces & data types.

1
0
0
Oscar Rojas
Created by Oscar Rojas over 4 years ago
Close

C++ Quiz 1

Question 1 of 6

1

Check all that are valid declarations:

Select one or more of the following:

  • long n = 100;

  • int a = 25

  • double {0.07};

  • unsigned __int16 = -69;

  • unsigned long double = 4.444;

Explanation

Question 2 of 6

1

What will the following code return:
#include <iostream>

int main() {
__int16 t = 1400;
std::cout << t + sizeof(t);
}

Select one of the following:

  • 1402

  • 1416

  • 1432

Explanation

Question 3 of 6

1

Which of the following may not be of type void?

Select one or more of the following:

  • Objects

  • Arrays

  • Functions

  • References

Explanation

Question 4 of 6

1

Select from the dropdown list to complete the text.

The range of values that a 32 bit int can hold are from [+/- ( 32,768, 1,200,000,000, 2,147,000,000, 9,000,000,000 )]

Explanation

Question 5 of 6

1

List the Floating Point types from least to greatest:

Drag and drop to complete the text.

    double, long double, float
    long double, double, float
    double, float, long double
    float, double, long double

Explanation

Question 6 of 6

1

Fill the blank spaces to complete the text.

Debug the following code:

#include <iostream>
#include <string> // Allows use of strings
//
int main() {
std::string n; //
int num //
std::cout<<"Enter a #"<< std::endl; //
std::getline(cin, n); //
>> num;
}
For lines w/o mistakes return 0

Explanation