C++ Programming that can Add Two numbers - 6 Players blogs for technology

give us your feedback

People Online

Breaking

ads

Post Top Ad

Thursday, September 5, 2019

C++ Programming that can Add Two numbers

#include <iostream>

using namespace std;

int main()
{
//this is a dynamic program that can add two numbers
    //variable declaration
    int a,b,c;
    //where a user can enter the first number
    cout<<"enter the first number: ";
    cin>>a;
     //where a user can enter the second number
    cout<<"enter the second number: ";
    cin>>b;
    c=a+b;
    cout<<"the sum of two number is:"<<c;
    return 0;
}


The output :
this is how the program work

enter the first number :
enter the second number :

if u enter the following like this


enter the first number : 20
enter the second number : 10
the sum of two number is: 30

No comments:

Post a Comment

ads1

Post Top Ad