w3resource

C#: Print the result of dividing two numbers


C# Sharp Basic: Exercise-3 with Solution

Divide Two Numbers

Write a C# Sharp program to print the result of dividing two numbers.

Division is one of the four basic operations of arithmetic, the others being addition, subtraction, and multiplication. The division of two natural numbers is the process of calculating the number of times one number is contained within one another.

C# sharp Exercises: dividing two numbers

Sample Solution:

C# Sharp Code:

// This is the beginning of the Exercise3 class
public class Exercise3
{
    // This is the main method where the program execution starts
    public static void Main()
    {
        // This line performs division of 36 by 6 and outputs the result to the console
        System.Console.WriteLine(36 / 6);
    }
}

Sample Output:

6

Flowchart:

Flowchart: C# Sharp Exercises - Print the result of dividing two numbers

C# Sharp Code Editor:

Previous: Write a C# Sharp program to print the sum of two numbers.
Next: Write a C# Sharp program to print the result of the specified operations.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/csharp-exercises/basic/csharp-basic-exercise-3.php