Advertisement
ntamas

2. program

Oct 14th, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace primek
  7. {
  8.   class Program
  9.   {
  10.     static void Main(string[] args)
  11.     {
  12.       string a;
  13.       int b, i=1, c=0;
  14.       int elemszam = 10;
  15.       int[] tomb = new int[elemszam];
  16.       Console.Write("Szαm: ");
  17.       a = Console.ReadLine();
  18.       b = Convert.ToInt32(a);
  19.       do
  20.       {
  21.         if(i % b == 0)
  22.         {
  23.           tomb[c] = i;
  24.           c++;
  25.         }
  26.         i++;
  27.       }while(c < elemszam);
  28.       for (int j = 0; j < elemszam; j++)
  29.       {
  30.         Console.WriteLine(tomb[j]);
  31.       }
  32.       Console.ReadKey();
  33.     }
  34.   }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement