Iniciar sesiónCrear cuenta

Dev - C++ - What is the value of "c" at the end of execution?

Vista:
Pos: 57
Val: 16

What is the value of "c" at the end of execution?

Publicado por Julio (6 intervenciones) el 28/01/2018 05:58:37
Question 13 (1 point) Question 13 Unsaved
What is the output?

{
int dateOfBirth = 1987;
int currentYear = 2006;

cout << "age is "
<< currentYear++ - dateOfBirth
<< endl;

cout << "age is "
<< currentYear++ - dateOfBirth
<< endl;
}
Question 13 options:

age is 18
age is 19

age is 19
age is 20

age is 20
age is 21

age is 21
age is 22

Save
Question 14 (1 point) Question 14 Unsaved
Write the C++ statement for the following: c=2pi r

Question 14 options:

Save
Question 15 (1 point) Question 15 Unsaved
Write the C++ statement for the following: 8+3=x

Question 15 options:

Save
Question 16 (1 point) Question 16 Unsaved
Write the C++ statement for the following: e =mc squared

Question 16 options:

Save
Question 17 (1 point) Question 17 Unsaved
Write the C++ statement for the following: x = one half times y

Question 17 options:

Save
Question 18 (1 point) Question 18 Unsaved
What is the value of c when the expression is evaluated:

int f = 34;
float c = (f - 32) * 5 / 9;
Question 18 options:

A)

0

B)

1.11

C)

0.0

D)

1.0

Save
Question 19 (1 point) Question 19 Unsaved
Write a function to display "Hello World".

Call it hello

Question 19 options:

Save
Question 20 (1 point) Question 20 Unsaved
Write a function to return a number.

Call it get

Question 20 options:

Save
Question 21 (1 point) Question 21 Unsaved
What is the output?

int two()
{
return 3;
}

int main()
{
int one = 2;
int three = two() + one;

cout << three << endl;

return 0;
}
Question 21 options:

5

3

2

1

Save
Question 22 (1 point) Question 22 Unsaved
What is the output?

void a()
{
cout << "a";
return;
}

void b()
{
cout << "bb";
return;
}

int main()
{
a();
b();
a();

return 0;
}
Question 22 options:

A)

abba

B)

abb

C)

a

D)

____

Save
Question 23 (1 point) Question 23 Unsaved
What is the output?

double a(double b, double c)
{
return b - c;
}

int main()
{
float x = a(4.0, 3.0);
float y = a(7.0, 5.0);

cout << a(x, y) << endl;

return 0;
}
Question 23 options:

A)

1.0

B)

3.0

C)

-1.0

D)

19.0

Save
Question 24 (1 point) Question 24 Unsaved
What is the output?

{
return n1 + n2;
}

int main()
{

cout << n4 << endl;

return 0;
}
Question 24 options:

0.0

0.3

0.7

1.0

Save
Question 25 (1 point) Question 25 Unsaved
What is the output?

void weird(int a, int &b)
{
a = 1;
b = 2;
}

int main()
{
int a = 3;
int b = 4;

weird(a, b);

cout << a * b << endl;
return 0;
}
Question 25 options:

6

2

12

4

Save
Question 26 (1 point) Question 26 Unsaved
What is the output?

void setTrue(bool a)
{
a = true;
return;
}

int main()
{
bool a = false;

setTrue(a);

cout << (int)a << endl;

return 0;
}
Question 26 options:

1

0

unknown

Save
Question 27 (1 point) Question 27 Unsaved
What is the output?

int main()
{
cout << a(b()) << endl;
return 0;
}

int a(int value)
{
return value * 2;
}

int b()
{
return 3;
}
Question 27 options:

2

3

6

error

Save
Question 28 (1 point) Question 28 Unsaved
What is the output?

char value = 'a';

int main()
{
char value = 'b';

if (true)
{
char value = 'c';
}

cout << value << endl;

return 0;
}
Question 28 options:

A)

a

B)

b

C)

c

D)

error

Save
Question 29 (1 point) Question 29 Unsaved
Write the code for the following function: Write a function to multiply two numbers. Call the function multiply().

Question 29 options:

Save
Question 30 (1 point) Question 30 Unsaved
Write the code for the following function: Write a function to represent the prerequisites for CS 165:
you must pass CS 124 and Math 110

Question 30 options:

Save
Question 31 (1 point) Question 31 Unsaved
Write main() to prompt the user for two numbers, call multiply(), and display the product.

Question 31 options:

Save
Question 32 (1 point) Question 32 Unsaved
Write a function to represent how to pass this class:
you can either earn a grade greater than or equal to 60% or you must bribe the professor.

Question 32 options:

Save
Question 33 (1 point) Question 33 Unsaved
Evaluate the following equation:

bool a = ('a' < 'a');
Question 33 options:
True
False
Save
Question 34 (1 point) Question 34 Unsaved
Evaluate the following equation:

bool b = ('b' > 'a');
Question 34 options:
True
False
Save
Question 35 (1 point) Question 35 Unsaved
Evaluate the following equation where the values of the variables a and b are from the previous two problems:

bool c = (a * 4) && b;
Question 35 options:
True
False
Save
Question 36 (1 point) Question 36 Unsaved
Evaluate the following equation when the values of b and c are from the previous problems:

bool d = !(b || (c || true));
Question 36 options:
True
False
Save
Question 37 (1 point) Question 37 Unsaved
Evaluate the following equation where the values of a, b, c, and d are from the previous problems:

bool e = a && b && c && d;
Question 37 options:
True
False
Save
Question 38 (1 point) Question 38 Unsaved
Evaluate the following equation where the values of a and b are from the previous problems:

bool g = (a != b) && true;
Question 38 options:
True
False
Save
Question 39 (1 point) Question 39 Unsaved
For the following, indicate where the parentheses goes to disambiguate the order of operations:

1 + 2 > 3 * 3

Question 39 options:

Save
Question 40 (1 point) Question 40 Unsaved
For the following, indicate where the parentheses goes to disambiguate the order of operations:

! a < b

Question 40 options:

Save
Question 41 (1 point) Question 41 Unsaved
For the following, indicate where the parentheses goes to disambiguate the order of operations:

a + b && c || d

Question 41 options:

Save
Question 42 (1 point) Question 42 Unsaved
For the following, indicate where the parentheses goes to disambiguate the order of operations:

2 * c++ > 2 + 7 == 9 % 2

Question 42 options:

Save
Question 43 (1 point) Question 43 Unsaved
For the following, indicate where the parentheses goes to disambiguate the order of operations:

a > b > c > d
Valora esta pregunta
-1