60 331
Assignments Done
98%
Successfully Done
In April 2018

Answer to Question #20140 in C# for kumar saurav

Question #20140
write a program to enter a number from 1 to 7 and display the corresponding day of the week.
Expert's answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
& static void Main(string[] args)
& {
Console.WriteLine("Enter a number please: ");
String num = Console.ReadLine();
if (num.Equals("1")) {
& Console.WriteLine("Monday");
}
else if (num.Equals("2"))
{
& Console.WriteLine("Tuesday");
}
else if (num.Equals("3"))
{
& Console.WriteLine("Wednesday");
}
else if (num.Equals("4"))
{
& Console.WriteLine("Thursday");
}
else if (num.Equals("5"))
{
& Console.WriteLine("Friday");
}
else if (num.Equals("6"))
{
& Console.WriteLine("Saturday");
}
else if (num.Equals("7"))
{
& Console.WriteLine("Sunday");
}
Console.ReadLine();
& }
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions