Advertisement
saleemthp

assignment2

Oct 6th, 2020
899
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. //******************************************************************************
  2. //  file:a2_subedi.cpp
  3. // Student:Bikash Subedi
  4. // Assignment:Assignment #2
  5. //Course Name:Programming I
  6. //Course Number : COSC 1550 - 01
  7.  
  8.  
  9. #include <iostream>
  10. using namespace std;
  11.  
  12. int main()
  13. {
  14.     int num1;
  15.  
  16.  
  17.     int num2;
  18.     int result;
  19.     string myString;
  20.     double num3;
  21.     double num4;
  22.     cout << endl;
  23.     num1 = 23;
  24.     num2 = 9;
  25.     result = num1 + num2;
  26.     cout << result << endl;
  27.     result = num1 - num2;
  28.     cout << result << endl;
  29.     result = num1/num2;
  30.     cout << result << endl;
  31.     result = num1 % num2;
  32.     cout << result << endl;
  33.     cout << endl;
  34.     num3 = 123.89;
  35.     num4 = 22.76;
  36.     result = num3 + num4;
  37.     cout << result << endl;
  38.     result = num3/num2;
  39.     cout << result << endl;
  40.     num4 = num3 / num2;
  41.     cout << num4 << endl;
  42.     myString = "Programming is great fun !";
  43.     cout << myString << endl;
  44.     cout << sizeof(myString) << endl;
  45.     cout << endl;
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.     return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement