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