Advertisement
Guest User

c# week 8 code

a guest
Mar 15th, 2012
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication12
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int a, b, c;
  13.             int n;
  14.             do
  15.             {
  16.                 try
  17.                 {
  18.                     a = int.Parse(Console.ReadLine());
  19.                     b = int.Parse(Console.ReadLine());
  20.                     c = a / b;
  21.                     Console.WriteLine(c);
  22.                     break;
  23.                 }
  24.  
  25.                 catch (FormatException)
  26.                 { Console.WriteLine("You 'derped out!"); }
  27.  
  28.                 catch (Exception ex)
  29.                 { Console.WriteLine("you did something WHAT, HOW DID THIS GET HERE I AM NOT GOOD WITH COMPUTERS."); }
  30.             }
  31.             while(true);
  32.  
  33.             Console.ReadLine();
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement