C# program | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C# program

Hepl me please,hwo to do -> write a c# program if the user enter 1 ,print sunday.

8th Jan 2024, 7:25 AM
ranoo muhamad
2 Answers
+ 8
ranoo muhamad welcome to Sololearn! There is a Sololearn tutorial that will help you get started learning C#. You can find it in the app under the Learn tab. Here is a link: https://www.sololearn.com/learn/courses/c-sharp-introduction
8th Jan 2024, 8:21 AM
Brian
Brian - avatar
+ 1
using System; class Program { static void Main() { Console.WriteLine("Enter a number:"); int userInput = Convert.ToInt32(Console.ReadLine()); if (userInput == 1) { Console.WriteLine("Sunday"); } else { Console.WriteLine("Invalid input. Please enter 1 for Sunday."); } } }
10th Jan 2024, 7:34 AM
Joseph Joseph
Joseph Joseph - avatar