Here is an example of a simple calculator in C# console application using if-else statements and while loop:
main.cs2336 chars66 lines
This calculator program prompts the user to enter an arithmetic operation (+, -, *, /) or 'q' to quit. If the input is valid, it prompts the user for two operands and performs the specified operation. If the input is invalid, it displays an error message and prompts the user again. The program continues to run until the user enters 'q' to quit.
gistlibby LogSnag