Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream.h>
  2. void main()
  3.     ind i,j;    //these three lines declare four variables
  4.     char c;
  5.     float x;
  6.     i = 4;      //i is assigned an integer literal
  7.     j = i+7;    // j  is assigned the result of a computation
  8.     c = 'a'     // enclose all vharacter literals
  9.                 //in single quotation marks
  10.     x= 9.087;   //x is floating-point value
  11.     x=x* 12.3f; //overwrites what was in x
  12.                 //with something else
  13.                 // (the f stops a conversion warning forcing the literal to be floating point)
  14.     //sends the values of the four variables to the screen
  15.     cout<<i<<", "<<j<<", "<<c<<", "<<x<<endl;
  16.    
  17.     return; //not required , but helpful
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement