V
V
Vadim Levkovich2021-11-10 22:52:10
C++ / C#
Vadim Levkovich, 2021-11-10 22:52:10

How to make the Calculator infinite in C#?

Hello! There was such a topic that I wrote a simple calculator . I want to put the entire if condition in a while . But when I select a number, an operation and a second number, just when I display the result, the loop goes to infinity.
Here's how I do it:
while (true)
{
*And here the if* condition itself is natural
}

PS I'm a beginner in C#

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2021-11-10
@jockermr07

The input must also be placed under the file

O
oleg_ods, 2021-11-10
@oleg_ods

If I understand correctly what you want to do, then add Console.ReadLine() at the end of the loop . Then the loop will reach the end and wait for pressing Enter to move to the next iteration.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question