1.05: Multiply, Using Variables

OBJECTIVE

Write a C# program to print the result of multiplying two numbers which will entered by the user. Compile it using Mono. Check that the resulting EXE file works properly.

RESOLUTION


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace My3Development
{
public class MultiplyUsingVariables
{
    public static void Main(String[] args)
    {
        int number1;
        int number2;
        int multiplication;
 
        System.Console.Writ("Enter 1st number");
        number1 = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("Enter 2nd number");
        number2 = System.Convert.ToInt32(Console.ReadLine());
 
        multiplication = number1 * number2;
        Console.WriteLine("The multiplication is: "+multiplication);

        }
    }
 }

DEMO RESULT


PREVIOUS                                             HOME                                                NEXT

0 comments :

Please Enter best of your Comments