Mam/ Sir I am facing a lot of problems I writing this code. I dont even know what a do while loop is. Can u pls give a short explanation as to how to proceed and write this code…
Doubts in basic calculator code
The Java do-while loop is used to iterate a part of the program several times. If the number of iteration is not fixed and you must have to execute the loop at least once, it is recommended to use do-while loop.
The Java do-while loop is executed at least once because condition is checked after loop body.
The while loop may run zero or more times but the Do - While may run more than one times but at least once.
Simply Put a loop and take input operator and then take input of two digits and then perform the operation till the user inputs ‘x’ or ‘X’.
you can see this: