Click here to Skip to main content
       

C / C++ / MFC

 
AnswerRe: reading cell value from excel through C++ Pingroup_AnsHUMAN_ 19-Feb-13 3:04 
Generalconvert the code VB6 to VC++ 6. PinmemberASEM.NET17-Feb-13 7:38 
GeneralRe: convert the code VB6 to VC++ 6. [modified] PinmemberDavidCrow17-Feb-13 12:17 
QuestionWinHttpClient code Pinmemberel_tel17-Feb-13 1:21 
AnswerRe: WinHttpClient code PinmvpRichard MacCutchan17-Feb-13 2:41 
GeneralRe: WinHttpClient code Pinmemberel_tel17-Feb-13 2:43 
QuestionCSplitter and CTabCtrl - looking for ideas PinmemberVaclav_Sal16-Feb-13 5:53 
Questioncalculator Pinmemberabhi sharma15-Feb-13 21:45 
// My first calculator//Abhi's calculator//
#include
 
using namespace std;
 
float division (float a, float b)
{
float a1;
a1=a/b;
return (a1);
}
float multiplication (float c, float d)
{
int a2;
a2=c*d;
return (a2);
}
float addition(float e, float f)
{
int a3;
a3=e+f;
return(a3);
}
float subtraction(float g, float h)
{
int a4;
a4=g-h;
return(a4);
}
int main()
{
char user;
float ab;
float da;
float ans;
 
cout<<endl<<"Welcome to Abhi's Calculator!"<<endl<<endl;
cout<<"(D) = Division(%)"<<endl;
cout<<"(M) = Multiplication(*)"<<endl;
cout<<"(A) = Addition(+)"<<endl;
cout<<"(S) = Subtraction(-)"<<endl<<endl;
 
cout<<"If you want Division then press D or d ->"<<endl;
cout<<"If you want Multiplication then press M or m ->"<<endl;
cout<<"If you want Additionthen then press A or a ->"<<endl;
cout<<"If you want Subtration then press S or s ->"<<endl<<endl;
 
cout<<"choose any one ->"<<endl<<endl;
cin>>user;
 
if (user == 'D' || user == 'd')
{
cout<<endl<<endl<<"What two numbers would you like to divide ->"<<endl<<endl;
cout<<"Enter 1st number ->"<<endl;
cin>>ab;
cout<<"Enter 2nd number ->"<<endl;
cin>>da;
ans = division (ab,da);
cout<<"Answer is -> "<<ans;
}
 
if (user == 'M' || user == 'm')
{
cout<<endl<<endl<<"What two numbers would you like to multiply ->"<<endl<<endl;
cout<<"Enter 1st number ->"<<endl;
cin>>ab;
cout<<"Enter 2nd number ->"<<endl;
cin>>da;
ans = multiplication (ab,da);
cout<<"Answer is -> "<<ans;
}
 
if (user == 'A' || user == 'a')
{
cout<<endl<<endl<<"What two numbers would you like to add ->"<<endl<<endl;
cout<<"Enter 1st number ->"<<endl;
cin>>ab;
cout<<"Enter 2nd number ->"<<endl;
cin>>da;
ans = addition (ab,da);
cout<<"Answer is -> "<<ans;
}
 
if(user == 'S' || user == 's')
{
cout<<endl<<endl<<"What two numbers would you like to subtract ->"<<endl<<endl;
cout<<"Enter 1st number ->"<<endl;
cin>>ab;
cout<<"Enter 2nd number ->"<<endl;
cin>>da;
ans = subtraction (ab,da);
cout<<"Answer is -> "<<ans;
}
cout<<endl<<"Do you want to continue"<<endl<<endl;
{
 
char a;
cout<<"yes ! -> press Y or y for yes"<<endl<<endl;
cout<<"no ! -> press N or n for no"<<endl<<endl;
cin>>a;
 
if(a=='y' || a=='Y')
{
 
main();
}
 
else if(a=='N' || a=='n')
{
cout<<endl<<"Press any key for stop a program"<<endl;
}
else
{
cout<<endl<<"@ ERROR!"<<endl<<"PLESE CHECK YOUR INPUT"<<endl;
}
 
}
 
}
AnswerRe: calculator PinmemberJibesh15-Feb-13 22:03 
AnswerRe: calculator Pinmember ProgramFOX17-Feb-13 4:42 
AnswerRe: calculator Pinmember庄伟东17-Feb-13 15:30 
QuestionHo to add auto scroll feature on Dialog box? PingroupVCProgrammer15-Feb-13 20:11 
AnswerRe: Ho to add auto scroll feature on Dialog box? PinmvpRichard MacCutchan15-Feb-13 22:21 
GeneralRe: Ho to add auto scroll feature on Dialog box? PingroupVCProgrammer17-Feb-13 17:30 
AnswerRe: Ho to add auto scroll feature on Dialog box? [modified] PinmemberFlaviu217-Feb-13 19:54 
QuestionClient Certificates in WinHTTP Pinmemberbasementman15-Feb-13 9:27 
QuestionPossible to resolve the question ... in a short time PinmemberHaiathem alhmoud15-Feb-13 7:48 
AnswerRe: Possible to resolve the question ... in a short time Pinmemberjeron115-Feb-13 8:08 
AnswerRe: Possible to resolve the question ... in a short time PinmemberDavidCrow16-Feb-13 14:56 
QuestionWindows 8 Modified Windows API List... PinmemberBlake Miller15-Feb-13 7:35 
AnswerRe: Windows 8 Modified Windows API List... PinmvpRichard MacCutchan15-Feb-13 22:18 
Question_IID_IXMLHTTPRequest linker error PinmemberMember 981141114-Feb-13 19:48 
AnswerRe: _IID_IXMLHTTPRequest linker error PinmvpRichard MacCutchan14-Feb-13 23:09 
AnswerRe: _IID_IXMLHTTPRequest linker error PinmemberDavidCrow15-Feb-13 5:31 
QuestionMCF PingroupFranksLIC14-Feb-13 10:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.140926.1 | Last Updated 30 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid