Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 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 Factorisation
  8. {
  9.     class Factorisation
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[] primeArray = { 2, 3, 5, 7, 11 };
  14.             Console.Write("Enter number: ");
  15.             int n = int.Parse(Console.ReadLine());
  16.  
  17.             for (int i = 0; i < primeArray.Length; i++)
  18.             {
  19.                 if (n % primeArray[i] == 0)
  20.                 {
  21.                     Console.Write(primeArray[i] + " ");
  22.                 }
  23.             }
  24.             Console.ReadKey(true);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement