Header Ads Widget

C++ program to add two numbers given by user

 

 C++ program to add two numbers given by user

Given two numbers , write a program to find the sum of both numbers .

Sample input :-

5
4

Sample output:-

9

 C++ program to add two numbers given by user

The objective of the code is to find the sum of two numbers given by user .

Code(C++):-

#include <bits/stdc++.h>
using namespace std;
int main() {
    int a,b,sum;
    cin>>a>>b;
    sum=a+b;
    cout<<sum<<endl;
}

Output:-

5
4
9

Recommended Post :-

HCL Coding Questions:-

Capgemini Coding Questions:-

Companies interview:-

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-