Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Übung_5_Beispiel_2
- {
- class Program
- {
- public static bool Teilbar(int zahl1, int zahl2)
- {
- bool erg = true;
- if (zahl1 % zahl2 != 0)
- {
- erg = false;
- }
- return erg;
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Dieses Programm überprüft ob Ihre erste durch Ihre zweite Zahl teilbar ist.");
- Console.WriteLine("Nennen Sie jetzt bitte Zahl 1.");
- int eingabe1 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Nennen Sie jetzt bitte Zahl 2.");
- int eingabe2 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine(Teilbar(eingabe1, eingabe2));
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement