CSharp - Write program to Add 10 more to the value you read from user


You will write a program that accepts a number from the user.

After that, it displays a number that is greater by ten than the one entered.



using System;
using System.Globalization;

class Program/*from w  w  w. j  a  v a 2 s.  com*/
    static void Main(string[] args)
        // Number input 
        Console.Write("Enter a number: ");
        string input = Console.ReadLine();
        int number = Convert.ToInt32(input);

        // Calculating 
        int result = number + 10;

        // Displaying the result 
        Console.WriteLine("Number greater by ten: " + result);