Guest User

exceptions

a guest
Nov 2nd, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. using System;
  2.  
  3. public class Test
  4. {
  5.     public static void Main()
  6.     {
  7.     double a,b,wynik;
  8.        
  9.     Console.WriteLine("Podaj liczbę a:");
  10.         string temp = Console.ReadLine();
  11.         a = float.Parse(temp);
  12.        
  13.         Console.WriteLine("Podaj liczbę b:");
  14.         temp = Console.ReadLine();
  15.         b = float.Parse(temp);
  16.        
  17.     try
  18.     {
  19.         wynik = a/b;
  20.     }
  21.     catch
  22.     {
  23.     //?
  24.     }
  25.    
  26.        
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment