Untitled
unknown
csharp
4 years ago
889 B
3
Indexable
Console.WriteLine("Kérlek adj meg egy számot!"); do { int inputNum = Int32.Parse(Console.ReadLine()); if (inputNum % 3 == 0) { Console.WriteLine("A szám oszható 3-al."); break; } else if (inputNum % 4 == 0) { Console.WriteLine("A szám osztható 4-el."); break; } else if (inputNum % 6 == 0) { Console.WriteLine("A szám oszható 6-al."); break; } else { Console.WriteLine("A szám nem osztható a következőkkel: 3, 4, 6."); Console.WriteLine("Kérlek adj meg egy másik számot!"); } } while (true);
Editor is loading...