Doubling a number using a delegate
C#
Easy
delegates
Task «Doubling a number using a delegate»
Write a program that uses a delegate to double an integer. Define a delegate that takes an integer and returns an integer. Create a method that doubles the number. Read an integer from the console, apply the delegate, and output the result.
Input Format
One integer n (-1000 ≤ n ≤ 1000).
Output Format
One integer — the result of doubling n.
Examples
Example 1
INPUT
5
OUTPUT
10
Example 2
INPUT
-3
OUTPUT
-6
main.cs