Write a C++ Program For Add Two Numbers

Ram Pothuraju
#include <iostream>
using namespace std;

int main() {

    float n1, n2, sum;
    cout << "Enter two numbers: ";
    cin >> n1 >> n2;
    sum = n1+n2;
    cout << "Sum = " << sum;
    return 0;
}


Output

Enter two numbers: 3.4
2.3
Sum = 5.7

Post a Comment

0Comments

Post a Comment (0)