// SImple Calculater
#include <iostream.h>
using namespace std;
int main()
{
system ("color f9");
double num, den, result; //declear funcatin
char op; // declear the opreaters "+,_,*,/"
do{ // mean that loop working when
cout<< "\n\t\tEnter the Number"<<endl;// User disply show
cin>> num; // user input
cout<<"\n\t\tEnter opreater +.-,*,/:"<<endl;//user disply show
cin>>op; // user input
cout<< "\n\t\tEnter the Second Number"<<endl; //user disply show
cin>>den;// user input
// Now when user want addation/multipaction/subtaractin/dividing user press the
//button "+,*,-,/"so result show input number then opreater
if(op=='+')result=num+den;
if(op=='-')result=num-den;
if(op=='*')result=num*den;
if(op=='/')result=num/den;
// Here any opreation work display screen result
cout << result << endl;
}// while
while (op!='e');
return 0;
}
To expand on your idea you might have to look at operator precedence and introduce a virtual stack to handle the operands and operators.
Ive used the reverse polish notation to handle converting infix to postfix for a similar calc/eval project in assembler. Using RPN allows you to specify other custom operators, like functions for string handling: concatenation, uppercase, stringtoval and logical operations and even possible including bitwise operations.
Wikipedia has a good entry on RPN using infix to postfix, and a breakdown of the steps that are used to calculate some examples: https://en.wikipedia.org/wiki/Reverse_Polish_notation
Keep up the good work
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hi @faheemahmad
I want to learn HTML, CSS, Javascript and then Java, C++ and all the languages that can help me become an android and IOS developer. Do you have any good website in mind where I can learn all these languages?
I have an accounting background but said bye bye to it, do you think a person like me can learn all these languages without having any IT degree?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@ghulammujtaba
Yes of-course
This Site is best for learning HTML, CSS ,JAVA
https://www.w3schools.com/html/ (HTML)
https://www.w3schools.com/css/default.asp (CSS)
https://www.w3schools.com/js/default.asp (JAVA)
https://www.w3schools.com/php/default.asp (PHP)
https://www.freelancer.com/community/articles/html-cheat-sheet-a-simple-guide-to-html?ft_prog=CFC&ft_prog_id=764 (HTML Guied Line)
C++ Learning for pratice Code
https://en.wikibooks.org/wiki/C%2B%2B_Programming/Exercises/Iterations#EXERCISE_1 ( Pratice C++ )
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks @faheemahmad
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
welcome
@ghulammujtaba
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit