krysycakes8556 krysycakes8556
  • 14-01-2021
  • Computers and Technology
contestada

Write code that outputs variable numDays as follows. End with a newline. If input is 3, output is: Days: 3

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 14-01-2021

Answer:

In C++:

#include<iostream>

using namespace std;

int main(){

int numDays;

cin>>numDays;

cout<<"Days: "<<numDays<<endl;

return 0;

}

Explanation:

This line declares numDays as integer

int numDays;

This line gets user input for numDays

cin>>numDays;

This line prints the required output and ends with a newline

cout<<"Days: "<<numDays<<endl;

Answer Link

Otras preguntas

label each of the following statement as true or false. If false, replace the underlined word or expression to produce a true statement
Name the written test a potential driver must pass and list the minimum required score to earn a learner’s license.
How does meiosis lead to genetic variability within a population use s. fimicola?
What interested you most about MLK? What surprised you? What did you learn
Rachel sells internet subscriptions by telephone. She receives 12% of the first $800 and 16% on the balance over $800. Last month, she sold $9,500 worth of in
Which statement is written in passive voice? A. The firefighters fought bravely against the wildfires in the forest. B. The town hall was filled by the co
In 1607 the first american colony was establishied on what river
Why was the income of nonfarm workers higher than that of farm workers in 1870?
How do I solve this? I'm so confused on what I'm doing
is there a way to see the color of cosmic rays the human eye can't see