### 1.2 Calculator in c++ by behzad khoker

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146`` ``````//By behzad khoker //Beta (1.2) //Please reply and tell me what sholud do to improve this //--------------------------------------------- #include #include using namespace std; //Operation starts here------------------------------------------ void sum(){ cout<<"Enter a number"<>num; cout<<"Enter another number"<>num2; ans=num+num2; cout<<"The answer is "<>num; cout<<"Enter a small number"<>num2; ans=num-num2; cout<<"The answer is "<>num; cout<<"Enter another number"<>num2; ans=num*num2; cout<<"The answer is "<>num; cout<<"Enter a small number"<>num2; ans=num/num2; cout<<"The answer is "<>enter; switch (enter) { case 1: cout<<"enter a number"<>num; cout<<"sin "<>num; cout<<"cos "<>num; cout<<"tan "<>f; c = (f - 32)*5/9; cout << f<<" Fahrenheit temperature is equal to Centigrade = " << c; } void equation(){ float a,b,c,ans; cout<<"Enter A"<>a; cout<<"enter B"<>b; cout<<"Enter c"<>c; ans= (-b + sqrt( b*b - ( 4*a*c ))) / (2 * a) ; cout<<"X ="<>ent; switch (ent) { case 1: sum(); break; case 2: subtract(); break; case 3: multiply(); break; case 4: divide(); break; case 5: sin(); break; case 6: temperature(); break; case 7: equation(); break; default: cout<<"invalid\n"; break;} system("pause"); }while(1); } //Operation Ends here------------------------------------------ void main(){ calculator(); } //------------------------------------------------------------------------------------------ ``````

What's the problem with it that you want us to help fix?
OP didn't actually post this as a question.
I want to know how to add colors to the text;
behzadkhoker .. if you want to add color to the text you will need to include this

#include <stdlib.h>
and use functions -> system("COLOR 0B");

take a look in here;

http://www.cplusplus.com/forum/beginner/1640/

OR here

0 = Black
1 = Blue
2 = Green
3 = Aqua
4 = Red
5 = Purple
6 = Yellow
7 = White
8 = Gray
9 = Light Blue
A = Light Green
B = Light Aqua
C = Light Red
D = Light Purple
E = Light Yellow
F = Bright White

For example if you use system("COLOR 1A"); you will get a Blue background and Light green text
Topic archived. No new replies allowed.