Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7199

CMD crashes before the end of the program

$
0
0

I have this code that calculates the average of an amount of values.The problem occurs when i try to run the .exe file, the questions go on normally until the point where it should tell you the average, thats where the console crashes (this also happens when tring to run simple "hello word" code).Heres a bit of the code:

        Console.WriteLine("Quantos valores serão calculados?");            QDV = Console.ReadLine();            QuantidadeDeValores = Convert.ToInt32(QDV);        for(cont=1;cont<=QuantidadeDeValores;cont++)        {            Console.Clear();            Console.WriteLine("Informe o valor: ");            valor = float.Parse(Console.ReadLine());            soma = soma + valor;        }        media = soma / QuantidadeDeValores;        Console.WriteLine("A média dos valores inseridos é:{0:N}",media);        Console.WriteLine("Arrivederci!");        }    }}

Tried "publishing" it multiple times on multiple folders, also, the program runs normally on the terminal in vscode

Thank you in advance!


Viewing all articles
Browse latest Browse all 7199

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>