C++ Online Compiler
Example: C++ program to find the sum of two integers
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// C++ program to find the sum of two integers #include <iostream> using namespace std; int main() { int p, q, r; cout << "Enter two integer values::\n\n"; cin >> p >> q; // calculating sum r = p + q; cout << "Result:: " << p << " + " << q << " = " << r; return 0; }
5 7
Output
Clear
ADVERTISEMENTS