Š ŠµŠ±ŃŃ‚ ŠŗтŠ¾ ŠæŠ¾Š“сŠŗŠ°Š¶ŠµŃ‚ ŠŗŠ°Šŗ Š¼Š¾Š¶Š½Š¾ сŠ¾ŠµŠ“ŠøŠ½Šøть фуŠ½ŠŗцŠøŠø Console.ReadLine Šø if-else(ŠøŠ»Šø Š¶Šµ switch)? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Š ŠµŠ±ŃŃ‚ ŠŗтŠ¾ ŠæŠ¾Š“сŠŗŠ°Š¶ŠµŃ‚ ŠŗŠ°Šŗ Š¼Š¾Š¶Š½Š¾ сŠ¾ŠµŠ“ŠøŠ½Šøть фуŠ½ŠŗцŠøŠø Console.ReadLine Šø if-else(ŠøŠ»Šø Š¶Šµ switch)?

23rd Mar 2020, 10:26 AM
Keyfi
Keyfi - avatar
4 Respostas
+ 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"); } } }
23rd Mar 2020, 11:03 AM
Sarthak
Sarthak - avatar
+ 1
Ok thank you I'm understand Console.ReadLine+if-else= bad idea Maybe i can combine Console.ReadLine and switch?
23rd Mar 2020, 11:07 AM
Keyfi
Keyfi - avatar
+ 1
Keyfi Its similar technique, just different syntax. Try to code that yourself. If any problem, we'll try to help.
23rd Mar 2020, 11:09 AM
Sarthak
Sarthak - avatar
+ 1
Ok thanks
23rd Mar 2020, 11:11 AM
Keyfi
Keyfi - avatar