The correct variable declaration

Suppose that x, y, z, and w are int variables. What is stored in x, y, z, and w after the following statements execute?

x = 9;

y = x – 4;

z = (y + 7) % 6;

w = (x * z) / y – 3;

z = w + (x – y + 2) % x;

Which of the following variable declarations are correct? If a variable declaration is not correct, give the reason(s) and provide the correct variable declaration.  (1, 7)

double conversion = 2.5; //Line 1

char grade = ‘B+’; //Line 2

double 28.5 = num //Line 3

string message = ”First C++ course’; //Line 4

int age = 18 years; //Line 5

int perfectSquare; //Line 6

float x, y, decimal; //Line 7

WhatsApp
Hello! Need help with your assignments?

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

🛡️ Worried About Plagiarism? Run a Free Turnitin Check Today!
Get peace of mind with a 100% AI-Free Report and expert editing assistance.

X