fork download
  1. //Taylor Johnson CS1A Chapter 2, P.83, #14
  2. /***************************************************************************
  3.  *
  4.  * Display Very Personal Information
  5.  * _________________________________________________________________________
  6.  * This Program will display personal name, adress, city, zip code, telephone
  7.  * number, and college major all on mostly separate lines only using one cout
  8.  * statement
  9.  *
  10.  * This program will fulfill desired output by using the proper syntax:
  11.  * cout << "name\n" << "adress," << "city," << "zip code/n"
  12.  * << "telephone number/n" << "major"
  13.  * ____________________________________________________________________________
  14.  * INPUT
  15.  * string "name", "address", "city",
  16.  * "zip code", "telephone number", "college major"
  17.  *
  18.  * OUTPUT
  19.  * taylor
  20.  * 123 street, san juan, 12345
  21.  * 123-456-7890
  22.  * comp sci
  23.  * ***************************************************************************/
  24.  
  25. #include <iostream>
  26. using namespace std;
  27.  
  28. int main()
  29. {
  30. //set a cout function to display each string on different lines using \n
  31. cout << "Peter Griffin\n" << "31 Spooner St," << "Quahog," << "00093\n" <<
  32. "(401)555-1125\n" << "Computer Science";
  33. return 0;
  34. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Peter Griffin
31 Spooner St,Quahog,00093
(401)555-1125
Computer Science