Evaluating Numerical Expressions

Practice Questions

Computer Science › Evaluating Numerical Expressions

Questions
9
1

What is the Unicode value for the letter "W"?

2

Consider the code below:

int a = 24, b = 17, c = 5, d = 7;

b = b % d + a / b;

a %= b;

a -= 12;

What is the value of a at the end of the code above?

3

Evaluate the mathematical equation?

4

int x = 2893;

  1. What does the expression " x / 10 " evaluate to?
  2. What does the expression " x % 10 " evaluate to?
5

int a = 49;

int b = 6;

``

int c = 49 % 6;

What is the value of c?

6

#include

using namespace std;

int main()

{

bool bin=true;

int var=bin*2 +1;

int triple=5;

int final= (bin&var) &triple;

cout<<final;

return 0;

}

What is the output of this code?

7

Consider the following code:

int i = 85, j = 2, k = 4;

i--;

j++;

k -= 6;

i = i / j + i / k;

What is the value of i in the code above?

8

int a = 5;

a += 3.14;

Using the language C++ or Java, what will the value of a be after the above code snippet?

9

int a;

a= 1+1 * 2 + 4 / 5;

System.out.println(a);

What would the code output?

Return to subject