Robot Barmen Help | Sololearn: Learn to code for FREE!

0

Robot Barmen Help

I tried doing this problem, but i dont get any output, can someone help me finding the error, please ? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { try { int drinks = Convert.ToInt32(Console.ReadLine()); int shelves = Convert.ToInt32(Console.ReadLine()); int result = drinks / shelves; Console.WriteLine(result); } /* * 1. DivideByZeroException => "At least 1 shelf" * 2. FormatException => "Please insert an integer" */ catch (DivideByZeroException e) { Console.WriteLine("At least 1 shelf") } catch (FormatException e) { Console.WriteLine("Please insert an integer") } } } }

2/8/2021 9:19:12 PM

Vini Souza

2 Answers

New Answer

+2

You're missing a semicolon inside both catch statements after Console.WriteLine(...).

0

Thanks a lot