Example 1: C++ program to perform the arithmetic operations
kw.cpp
Output
kodingwindow@kw:~$ g++ kw.cpp
kodingwindow@kw:~$ ./a.out 8+7=15 7+8=15 8-7=1 7-8=-1 8*7=56 8/7=1 7/8=0 8%7=1 7%8=7 kodingwindow@kw:~$
Example 2: C++ program to perform the arithmetic operations
kw.cpp
Output
kodingwindow@kw:~$ g++ kw.cpp
kodingwindow@kw:~$ ./a.out 16 63 kodingwindow@kw:~$
Example 3: C++ program to perform the arithmetic operations
kw.cpp
Output
kodingwindow@kw:~$ g++ kw.cpp
kodingwindow@kw:~$ ./a.out ——————————————————————————————————————————— Program for the arithmetic operations ——————————————————————————————————————————— Value of a | 0 Value of b | 1 Value of 0 / 1 | 0 Value of 0 + 1 | 1 Value of 0 - 1 | -1 Value of 0 * 1 | 0 Value of 0 % 1 | 0 Value of a++ | 0 Value of ++a | 2 ——————————————————————————————————————————— kodingwindow@kw:~$
What Next?
C++ program to perform the boolean operations
C++ program to perform the relational operations
C++ program to perform the assignment operations
Advertisement