Write a single C++ statement to accomplish each of the following (assume that us
ID: 3938403 • Letter: W
Question
Write a single C++ statement to accomplish each of the following (assume that using declarations have not been used): Declare the variables c, thisIsAVariable, q76354 and number to be of type int. Prompt the user to enter an integer. End your prompting message with a colon (:) followed by a space and leave the cursor positioned after the space. Read an integer from the user at the keyboard and store it in integer variable age. If the variable number is not equal to 7, print "The variable number is not equal to 7". Print the message "This is a C++ program" on one line. Print the message "This is a C++ program" on two lines. End the first line with C++. Print the message "This is a C++ program" with each word on a separate line. Print the message "This is a C++ program". Separate each word from the next by a tab.Explanation / Answer
a) int c,thisIsAVariable,q76354,number;
b) cout<<" Enter an integer: ";
c) int age; cin>>age;
d) if(number != 7) cout<<" The variable number is not equal to 7";
e) cout<<" This is a C++ program";
f) cout<<" This is a C++ program";
g) cout<<" This is a C++ program";
h) cout<<" This is a C++ program";
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.