Basic calculator No output


no output received

There are certain errors in your code, Firstly I would recommend you to use do while loop instead of only while loop ,
Then even if you use only while loop, make sure you use the correct conditions, error in line no 7
while(ch!=‘x’&& ch!=‘X’)
error in line no 11 : else if(ch!=‘x’&&ch!=‘X’)
Try using this condition instead . while(ch!=‘X’|| ch!=‘x’||ch==’+’|| ch==’-’ || ch==’/’ || ch==’*’ || ch==’%’ )
as per wht is given in question

Refer to this code, I have edited it and now it is producing output ,

1 Like