0

Help with visual studio

i wrote this code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args){ //trying my new learnings Console.WriteLine("What's your name?"); string Username = Console.ReadLine(); Console.WriteLine("Hello {0}",Username); Console.WriteLine("Please Enter Your Favorite Number:"); int Fnum = Convert.ToInt32(Console.ReadLine()); if (Fnum > 10) { switch (Fnum) { case 11: Console.WriteLine("You are ..."); break; case 12: Console.WriteLine("You are LuckY"); break; default: Console.WriteLine("No idea :)"); break; } } else { Console.WriteLine("Just be careful if you are walking home :P"); } } } } and after entering a number for "Fnum" the Console app will be closed. Is there any problem in my code??

1st Aug 2019, 11:34 AM
Alireza B
Alireza B - avatar
1 Réponse
+ 1
ctrl + f5 or set your subsystem to console or add a breakpoint at the end of code
1st Aug 2019, 11:44 AM
James
James - avatar