FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 123   



Following program shows you how to take two numbers from user and add those two numbers.
In this program we take two numbers from user using std::cin method and add those two numbers

#include <iostream>
int main() {
    int input1;
    int input2;

    std::cout << "Enter first number:";
    std::cin >> input1;

    std::cout << "Enter second number:";
    std::cin >> input2;

    int result = input1 + input2;

    std::cout << "Sum of the given two numbers is: " << result;
}

Output:

Enter first number: 20
Enter second number: 2
Sum of the given two numbers is: 22



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News