Return to Topic Menu | Computer Science Main Page | MathBits.com  | Terms of Use

Demo 3:  Demo of cout<<

 
//************************************
//    Name:  Kate Janeway
//    Assignment:  Unit 1 #3
//    A Print Investigation program
//    Date:  Stardate 2506
//************************************ 

#include <iostream.h>
#include <stdlib.h>

int main(void)
{
      system ("CLS");
      cout<< “Welcome to the bridge!\n”;
      cout<< "Did you notice that backslash n was inside the quotes?" <<endl;
      cout<< "Did you notice that endl was outside the quotes?" <<endl;
      cout<< "Watch out for lines";
      cout<< "that continue from the previous line."<<endl;
      cout<<"Did you notice NO space between \"lines\" and \"that\"?\n";
      cout<< "Some\t\t\tImportant\t\t\tMoves\n";

     return 0;  
}
 

Screen Display

Welcome to the bridge!
Did you notice that backslash n was inside the quotes?
Did you notice that endl was outside the quotes?
Watch out for linesthat continue from the previous line.
Did you notice NO space between "lines" and "that"?
Some                           Important                     Moves
  (spacing not exact for the tabs)

 

Return to Topic Menu | Computer Science Main Page | MathBits.com  | Terms of Use