Advertisement
TheWhiteFang

[C++][3] Variables

Oct 6th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream> //pre-processor directive
  2.  
  3. using namespace std; //std library
  4.  
  5. int main() //it starts with the main 1st
  6. {
  7.     int a = 4; //variable a
  8.     int b = 21; //variable b
  9.  
  10.     int sum = a + b; //summation
  11.     int diff = a - b; // subtraction/difference
  12.  
  13.     cout << sum << endl;
  14.     cout << diff;
  15.  
  16.     return 0; //to tell that program ran fine
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement