Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream.h>
- void main()
- ind i,j; //these three lines declare four variables
- char c;
- float x;
- i = 4; //i is assigned an integer literal
- j = i+7; // j is assigned the result of a computation
- c = 'a' // enclose all vharacter literals
- //in single quotation marks
- x= 9.087; //x is floating-point value
- x=x* 12.3f; //overwrites what was in x
- //with something else
- // (the f stops a conversion warning forcing the literal to be floating point)
- //sends the values of the four variables to the screen
- cout<<i<<", "<<j<<", "<<c<<", "<<x<<endl;
- return; //not required , but helpful
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement