Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Exercises 2.3 Write a single C++ statement to accomplish each of the following (

ID: 3876136 • Letter: E

Question

Exercises 2.3 Write a single C++ statement to accomplish each of the following (assume that using directives have not been used):

a)Declare the variables c, thisIsAVariable, q76354 and number to be of type int.

b)Prompt ( ask) the user to enter an integer number .

c)Read an integer called (age) from the user at the keyboard and store it in integer variable.

d)If the variable number is not equal to 7, print "The variable number is not equal to 7".

e) Print the message "This is a C++ program" on one line.

g) Print the message "This is a C++ program" with each word on a separate line.

h) Print the message "This is a C++ program". Separate each word from the next by a tab.

f) Compute the product of the three integers contained in variables x, y and z, and assign the result to the variable result

Explanation / Answer

a) int c , thisIsAVariable , q76354 , number ;

b) cout<<" Enter an integer input : ";

c) cin>>age;

d) of(variable!=7) cout<<" The variable is not equal t o 7 ";

e) cout<<" This is a C++ program ";

f) result = x*y*z;

g) cout<<" This is a C++ program ";

h) cout<<" This is a C++ program ";

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote