Chapter 2 – Q #14 Personal Information – Tony Gaddis – Starting Out With C++
Problem: -
Write a program that displays the following pieces of information, each on a separate line:
Your name
Your address, with city, state, and ZIP code
Your telephone number
Your college major
Use only a single cout statement to display all of this information.
Solution: -
#include <iostream>
using namespace std;
int main()
{
cout << "Your name\nYour adress, with city, state, and ZIP code\nYour <<Telephone number\nYour college major";
return 0;
}
This is the solution of this question
OUTPUT OF THIS QUESTION
Explanation of this Solution
- Use only single cout statement to print this given information and use \n for new line.
- Return 0 to the main function.
Also, I attach CPP file of this problem. You can download this file
0 Comments