Answer to Question #243804 in C# for mack

Question #243804

Write an application that displays the result of dividing two numbers and displays any

remainder. The main() method prompts the user for values and sends them to the dividing

method; the dividing method performs the calculation and displays the results. Save the

application as Divide.cs


1
Expert's answer
2021-09-28T13:11:11-0400
using System;


namespace Questions
{
    class Program
    {
        static void dividing(double firstNumber, double secondNumber)
        {
            double divisionResult = firstNumber / secondNumber;
            Console.WriteLine("Division result: " + divisionResult);


            double reminder = firstNumber % secondNumber;
            Console.WriteLine("Reminder: " + reminder);
        }
        static void Main()
        {
            Console.Write("Enter first number: ");
            double firstNumber = double.Parse(Console.ReadLine());


            Console.Write("Enter second number: ");
            double secondNumber = double.Parse(Console.ReadLine());
            Console.WriteLine();


            dividing(firstNumber, secondNumber);


            Console.ReadKey();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS