+ 1

What is wrong with this code

int numbersold = Console.ReadLine(); int cost = 21,000,000; int numbersoldprice = numbersold * 3,000,000; if(numbersoldprice > cost ) { Console.WriteLine("Profit") ; } else if (numbersoldprice == cost) { Console.WriteLine("Broke even"); } else { Console.WriteLine("Loss"); }

12th Dec 2021, 5:34 PM
Kageyama Tobio
1 Odpowiedź
+ 5
Line 1: you should convert the input from string to int https://code.sololearn.com/cPTM3QszIepA/?ref=app
12th Dec 2021, 5:38 PM
Anwar Sh
Anwar Sh - avatar