Chapter 2 – Q #14 Personal Information – Tony Gaddis – Starting Out With C++

Chapter 2 – Q #14 Personal Information – Tony Gaddis – Starting Out With C++


Personal Information



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


  1. Use only single cout statement to print this given information and use \n for new line.
  2. Return 0 to the main function.

Also, I attach CPP file of this problem. You can download this file

Click Here to Download This File




Thanks!  

Post a Comment

0 Comments