1. Senior Member+
Last Online
4th April 2019 @ 07:44 AM
Join Date
14 Feb 2018
Gender
Male
Posts
100
42
Credits
-1,186
Thanked
2

## calculator in c++

/* prepared by : HILAL AHMAD HUSSAIN (STUDENT: SOFTWERE ENGINEERING)
*/
#include<iostream>
#include<conio.h>
int sub(int a,int b);
int mul(int a,int b);
int div(int a,int b);
using namespace std;
int main()
{
int m,n;
xy:
cout<<endl;
cout<<"___________________________________________ __________________________"<<endl;
cin>>m;
cout<<endl;
cin>>n;
cout<<endl;
cout<<"2: for substriction"<<endl;
cout<<"3: for multifaction "<<endl;
cout<<"4: for division"<<endl;
char op;
cin>>op;
switch(op)
{
if(op=='1')
{
case '1':
break;
}
else{
}
if(op=='2')
{
case '2':
sub( m, n);
break;
}
else{
}
if(op=='3')
{
case '3':
mul(m, n);
break;
}
else{
}
if(op=='4')
{
case'4':
div( m, n);

}else{

}
default:
cout<<"invilid option----";
}
goto xy;
}
{
cout<<"--------------------------------"<<endl;
cout<<"the addition of a and b ="<<a+b<<endl;
cout<<"--------------------------------"<<endl;
cout<<endl;

}
int mul(int a, int b)
{
cout<<"--------------------------------"<<endl;
cout<<"the multifaction of a and b="<<a*b<<endl;
cout<<"--------------------------------"<<endl;
cout<<endl;

}
int sub(int a,int b)
{
cout<<"--------------------------------"<<endl;
cout<<"the substraction of a and b="<<a-b<<endl;
cout<<"--------------------------------"<<endl;
cout<<endl;
}
int div(int a,int b)
{
if(b==0)
{
cout<<"--------------------------------"<<endl;
cout<<"a is not divide by zero"<<endl;
cout<<"--------------------------------"<<endl;
}
else
{
cout<<"--------------------------------"<<endl;
cout<<"the division of a and b="<<a/b<<endl;
}

cout<<endl;

}

dear no error see result again
Last edited by hussain king; 30th March 2018 at 09:12 PM.

2. ٹھیک ہے جناب ضرور اس کو بھی ٹرائی کریں گے

ابھی تک پروگرام پڑھ کر سمجھنا کچھ کچھ آگیا ہے کہ کیا کیا کام ہو رہا ہے اور کس طرح
جب آغاز کریں گے تو ضرور ٖضرور آپ کا دماغ کھائیں گے
بہت شکریہ

3. Junior Member
Last Online
1st July 2018 @ 01:35 AM
Join Date
10 Mar 2018
Gender
Male
Posts
3
0
Credits
65
Thanked
0
super hit

4. Junior Member
Last Online
1st July 2018 @ 01:35 AM
Join Date
10 Mar 2018
Gender
Male
Posts
3
0
Credits
65
Thanked
0
4:19: fatal error: conio.h: No such file or directory
compilation terminated.
yaha problem dy raha hy Bahi#hussain King

5. Senior Member+
Last Online
4th April 2019 @ 07:44 AM
Join Date
14 Feb 2018
Gender
Male
Posts
100
42
Credits
-1,186
Thanked
2
dear friends conio.h ma koye problem nahe ha ap konsa compiler use karte ha dev 5.11 version install karo c drive ma per daklo

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•