Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Filip_28_10_2023
- {
- class Program
- {
- static void Main(string[] args)
- {
- string imie, nazwisko;
- int wiek = 12;
- int a, b;
- Console.Write("Podaj imię: ");
- imie = Console.ReadLine();
- Console.Write("Podaj a: ");
- a = int.Parse(Console.ReadLine());
- Console.Write("Podaj b: ");
- b = int.Parse(Console.ReadLine());
- int suma = a + b;
- int roznica = a - b;
- int iloczyn = a * b;
- Console.Clear();
- Console.WriteLine($"Cześć {imie}, to wyniki Twoich obliczeń: ");
- Console.WriteLine();
- Console.WriteLine($"{a} + {b} = {suma}");
- Console.WriteLine($"{a} - {b} = {roznica}");
- Console.WriteLine($"{a} * {b} = {iloczyn}");
- if (b != 0)
- {
- double iloraz = (double)a / b; //szybkie rzutowanie
- Console.WriteLine($"{a} / {b} = {iloraz}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement