daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 128 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Division
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int number = int.Parse(Console.ReadLine());
  10.  
  11.             if (number % 2 == 0)
  12.             {
  13.                 if (number % 10 == 0)
  14.                 {
  15.                     Console.WriteLine("The number is divisible by 10");
  16.                 }
  17.                 else if (number % 6 == 0)
  18.                 {
  19.                     Console.WriteLine("The number is divisible by 6");
  20.                 }
  21.                 else
  22.                 {
  23.                     Console.WriteLine("The number is divisible by 2");
  24.                 }
  25.             }
  26.             else if (number % 3 == 0)
  27.             {
  28.                 if (number % 6 == 0)
  29.                 {
  30.                     Console.WriteLine("The number is divisible by 6");
  31.                 }
  32.                 else
  33.                 {
  34.                     Console.WriteLine("The number is divisible by 3");
  35.                 }
  36.             }
  37.             else if (number % 6 == 0)
  38.             {
  39.                 Console.WriteLine("The number is divisible by 6");
  40.             }
  41.             else if (number % 7 == 0)
  42.             {
  43.                 Console.WriteLine("The number is divisible by 7");
  44.             }
  45.             else if (number % 10 == 0)
  46.             {
  47.                 Console.WriteLine("The number is divisible by 10");
  48.             }
  49.             else
  50.             {
  51.                 Console.WriteLine("Not divisible");
  52.             }
  53.         }
  54.     }
  55. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top