O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Write a c++ program that will prompt a user to input one word answers.docx

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio

Confira estes a seguir

1 de 2 Anúncio

Write a c++ program that will prompt a user to input one word answers.docx

Baixar para ler offline

Write a c++ program that will prompt a user to input one word answers to the following questions.
What is your name? What state do you live in? What year did you start college?
Once the user has entered the answer to each question, output as follows:
Hello,
My name is name. I am from state. I enrolled in college in year.
Solution
#include <iostream>
using namespace std;
int main()
{
int year;
char name[20],state[20];
cout<<\"What is your name? : \";
cin>>name;
cout<<\"What state do you live in?: \";
cin>>state;
cout<<\"What year did you start college? : \";
cin>>year;
cout<<\"\ Hello,\";
cout<<\"\ My name is \"<<name<<\".\";
cout<<\"I am from \"<<state<<\".\";
cout<<\"\ I enrolled in college in \"<<year<<\".\";
}
.

Write a c++ program that will prompt a user to input one word answers to the following questions.
What is your name? What state do you live in? What year did you start college?
Once the user has entered the answer to each question, output as follows:
Hello,
My name is name. I am from state. I enrolled in college in year.
Solution
#include <iostream>
using namespace std;
int main()
{
int year;
char name[20],state[20];
cout<<\"What is your name? : \";
cin>>name;
cout<<\"What state do you live in?: \";
cin>>state;
cout<<\"What year did you start college? : \";
cin>>year;
cout<<\"\ Hello,\";
cout<<\"\ My name is \"<<name<<\".\";
cout<<\"I am from \"<<state<<\".\";
cout<<\"\ I enrolled in college in \"<<year<<\".\";
}
.

Anúncio
Anúncio

Mais Conteúdo rRelacionado

Mais de lez31palka (20)

Mais recentes (20)

Anúncio

Write a c++ program that will prompt a user to input one word answers.docx

  1. 1. Write a c++ program that will prompt a user to input one word answers to the following questions. What is your name? What state do you live in? What year did you start college? Once the user has entered the answer to each question, output as follows: Hello, My name is name. I am from state. I enrolled in college in year. Solution #include <iostream> using namespace std; int main() { int year; char name[20],state[20]; cout<<"What is your name? : "; cin>>name; cout<<"What state do you live in?: "; cin>>state; cout<<"What year did you start college? : "; cin>>year; cout<<" Hello,"; cout<<" My name is "<<name<<"."; cout<<"I am from "<<state<<"."; cout<<" I enrolled in college in "<<year<<"."; }

×