StoimenK

C# 2.2 Division

Jan 20th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Division
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int num = int.Parse(Console.ReadLine());
  14.  
  15.             if (num % 10 == 0)
  16.             {
  17.                 Console.WriteLine("The number is divisible by 10");
  18.             }
  19.  
  20.             else if (num % 7 == 0)
  21.             {
  22.                 Console.WriteLine("The number is divisible by 7");
  23.             }
  24.  
  25.             else if (num % 6 == 0)
  26.             {
  27.                 Console.WriteLine("The number is divisible by 6");
  28.             }
  29.  
  30.             else if (num % 3 == 0)
  31.             {
  32.                 Console.WriteLine("The number is divisible by 3");
  33.             }
  34.  
  35.             else if (num % 2 == 0)
  36.             {
  37.                 Console.WriteLine("The number is divisible by 2");
  38.             }
  39.  
  40.             else
  41.             {
  42.                 Console.WriteLine("Not divisible");
  43.             }
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment