Qus:    How do you make a dotnet application that says yes when you say no?
Apr 20, 2021 12:08 1 Answers Views: 15 SAI
Prev Next
Answers (1)
TEJA Apr 21, 2021 09:10
Answer:   You can create a console application in this case with below logic –
using System;
namespace Demo
{
class Program
{
static void Main(string[] args)
{
string input = string.Empty;
Console.WriteLine("Enter your input”);
input = Console.ReadLine();
if(input.ToLower() == “yes”)
Console.WriteLine(“no”);
else if(input.ToLower() == “no”)
Console.WriteLine(“yes”);
else
Console.WriteLine(“invalid input”);
}
}
}

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect