-
calculator??
I want to make claculator that reciev the equation and after he puts '=' the calculator give him the answer..
I created 2D array of chars... I want to fill the first column UNTIL the user puts operation (+ or - or * or /) if the prog. recieve oper. it will goto the next column..until now I didn't success Why??
[code2]
main()
{
int i,u=0;
for (i=0 i<13;i++)
do
{
scanf("%c",&num[u][i]
if (num[u][i]=='+')//I'll do the same with (- * / )
{
u++;
i=0;
}until (num[u][i]=='=');
[/code2]
OK this is general idia about the prog.. Where is the problem??
(don't care about defining variables)
-
Do you care about defining arrays? :)
Edit:
I think you best bet would be using a string and then just input the entire thing the user enters and go from there.