add two number

#include<iostream.h>
#include<iomanip.h>
int main()
{
int num1,num2,sum;
cout<<"enter the first number that you want to add\n";
cin>>num1;
cout<<"enter the second number that you want to add\n";
cin>>num2;
sum=num1+num2;
cout<<"the result is"<<setw(3)<<sum;
}
Thanks for the in-depth tutorial on this challenging yet critical aspect of software engineering. Do you have a book or something that aggregates more such lessons?
Wow, thanks a lot for sharing this.
i was wondering for years on how to add two numbers..

closed account (28poGNh0)
come on guys appreciate the effort

This how to add two strings abel12512 enjoy

# include <iostream>
using namespace std;

int main()
{
string str1 = "Nice begining ",str2("abel12512");
string str3 = str1 + str2;
cout << str3 << endl;
}
Last edited on
Topic archived. No new replies allowed.