was wondering if someone could help me on this slight problem my rogram compiles but a section doesnt seem to run..

}
void main()
{
clrscr();
int one, two, three;
char choice=' ', input[5];
while (choice != 'e')
{
cout<<"\nPlease enter +,-,*,/ or sqrt and then two numbers,\nsepperated by spaces, that you wish to\nadd,subtract,multiply,divide or sqrt.\nType e and press enter to exit.";



cin>>choice;
if (choice != 'e')
{
calc(choice);
}
}
}
  • im trying to square root a number and find the answer.. i need to get the input into the last variable in order for it to square root and find the value..?

thats just a portion where im having trouble!

char choice=' ';//one char

If I enter sqrt, does this fit into one char?
Never use void main; it's always int.

you'd have to use sme string comparison here, I'm making a calulator program at the minute... Having fun :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.