Answers for "c# divide two integers"

C#
1

divide int in c#

using System;

namespace Divide{
  
  public class Program{

      public static int division(int a, int b){
          return (a/b);
      }

      public static void Main(){
          int a,b;
          int quotient;

          Console.Write("Enter first number: ");
          a = Convert.ToInt32(Console.ReadLine());

          Console.Write("Enter second number: ");
          b = Convert.ToInt32(Console.ReadLine());

          quotient = division(a,b);

          Console.WriteLine("Quotient is: " + quotient);
		}
  	}
}
Posted by: Guest on August-28-2021
0

c# int division to double

double num3 = (double)num1/(double)num2;
Posted by: Guest on July-24-2020

Code answers related to "c# divide two integers"

C# Answers by Framework

Browse Popular Code Answers by Language