/*Three numbers will be entered by user and the rest of two will be added automatically by Computer.Your answer will be shown after the input of First Number*/
#include<iostream>
using namespace std;
#include<conio.h>
void main()
{
int a,b,c,d,e,sum;
cout<<"All integers should be from 100 to 999"<<endl<<"you will enter 3 integers and computer will 2 extra number automatically to it"<<endl;
cout<<"As you enter first integer the computer will tell you the sum of all 5 integers"<<endl<<"Enter first integer:"<<endl;
cin >> a;
a-=2;
if(a+2==100||a+2==101)
{
cout<<endl<<"20"<<a<<" will be your answer:"<<endl<<endl;
}
else
{
cout<<endl<<"2"<<a<<" will be your answer:"<<endl<<endl;
}
a+=2;
cout<<"Enter second integer:"<<endl;
cin>>b;
c=999-b;
sum=a+b+c;
cout<<"Enter third integer:"<<endl;
cin>>d;
e=999-d;
sum=sum+d+e;
cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"+"<<e<<"="<<sum<<endl;
getch();
}
#include<iostream>
using namespace std;
#include<conio.h>
void main()
{
int a,b,c,d,e,sum;
cout<<"All integers should be from 100 to 999"<<endl<<"you will enter 3 integers and computer will 2 extra number automatically to it"<<endl;
cout<<"As you enter first integer the computer will tell you the sum of all 5 integers"<<endl<<"Enter first integer:"<<endl;
cin >> a;
a-=2;
if(a+2==100||a+2==101)
{
cout<<endl<<"20"<<a<<" will be your answer:"<<endl<<endl;
}
else
{
cout<<endl<<"2"<<a<<" will be your answer:"<<endl<<endl;
}
a+=2;
cout<<"Enter second integer:"<<endl;
cin>>b;
c=999-b;
sum=a+b+c;
cout<<"Enter third integer:"<<endl;
cin>>d;
e=999-d;
sum=sum+d+e;
cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"+"<<e<<"="<<sum<<endl;
getch();
}