0
Ребят кто подскажет как можно соединить функции Console.ReadLine и if-else(или же switch)?
4 Réponses
+ 3
But, What you mean by COMBINING if else and Console.ReadLine()?
Maybe this:
using System;
public class Program
{
public static void Main()
{
Console.WriteLine("Enter Password");
string password = Console.ReadLine();
if (password == "abcdef") {
Console.WriteLine("Correct Password");
}else {
Console.WriteLine("Incorrect Password");
}
}
}
+ 1
Ok thank you
I'm understand
Console.ReadLine+if-else= bad idea
Maybe i can combine Console.ReadLine and switch?
+ 1
Keyfi
Its similar technique, just different syntax. Try to code that yourself. If any problem, we'll try to help.
+ 1
Ok thanks