C++

#include <iostream> using namespace std; int main ()
{ int a = 2; int b = 3; //Arith op int c = a + b; // (a - b) or (a * b) or (a / b) cout << c << endl; //relat op if (a == b) // (a != b) or (a > b) or (a <= b) { cout << "true stmt" << endl; } else { cout << "false stmt" << endl; } //logic op (0 means false, 1 means true) int x = 0; int y = 1; if (x && y) // (x || y) or !(x) or !(x && y) or !(x || y) { cout << "true stmt" << endl; } else { cout << "false stmt" << endl; } //assign op int d =+ a; // d =- a or d =* a cout << d << endl; //Misc op cout << sizeof(a) << endl; (a == b) ? cout << "true statement" << endl : cout << "false statement" << endl;
}
Enter fullscreen mode
Exit fullscreen mode

Discover more from Coursity

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Coursity

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top
The benefits of smart home air quality monitors. 2025 jamb questions and answers |free 2025 jamb answers. Strategies for effective money management.