Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- double a = 0;
- double b = 0;
- Console.Write("Kérem a(z) 'A' számot: ");
- a = Convert.ToDouble(Console.ReadLine());
- Console.Write("Kérem a(z) 'B' számot: ");
- b = Convert.ToDouble(Console.ReadLine());
- double c = a / b;
- double d = b / a;
- if (a < b)
- {
- if (a == 0)
- {
- Console.WriteLine("Nullával nem lehet osztani");
- }
- else
- {
- Console.WriteLine("'B' osztva 'A'-val: {0:0.00} ", d);
- }
- }
- if (b < a)
- {
- if (b == 0)
- {
- Console.WriteLine("Nullával nem lehet osztani");
- }
- else
- {
- Console.WriteLine("'A' osztva 'B'-vel: {0:0.00} ", c);
- }
- }
- if (a == 0 && b == 0)
- Console.WriteLine("Hiba");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement