Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- //+ - * / %
- cout << 3 * 3 << endl;
- cout << 10 / 3 << endl;
- cout << 10 % 3 << endl;
- cout << 7 / 2 << endl;
- cout << 7 % 2 << endl;
- //+= -= *= /= %=
- int no = 5;
- no += 10;
- no %= 2;
- //++var var++ --var var--
- cout << no++ << endl;
- cout << --no << endl;
- cout << no-- << endl;
- cout << no << endl;
- //precedence/DMAS
- //use of round brackets
- cout << 10 / 4 * 2 - 10 + 15 / 4 << endl;
- cout << 10 / (((6 - 3) * 10) + ((20 - 10) % 4));
- //type casting
- cout < 3/2.0 << endl;
- int no2 = 7;
- cout << 5/(float)no2 << endl;
- int pause;
- cin >> pause;
- return 0;
- }
Add Comment
Please, Sign In to add comment