Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5.     public void Main(string[] args)
  6.     {
  7.         if (int.TryParse(Console.ReadLine(), out number))
  8.         {
  9.             Console.WriteLine(number * 2);
  10.         }
  11.         else
  12.             Console.WriteLine("Invalid input!\nInteger was asked.");
  13.        
  14.         Console.WriteLine("Press a key to exit the program...");
  15.         Console.ReadKey();
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement