Advertisement
BloodMoonYTC

ketteshatvanyai

Oct 24th, 2021 (edited)
787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ketteshatvanyai
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Kólity Kristóf");
  10.             Console.Write("Irj be egy számot: ");
  11.             int a = int.Parse(Console.ReadLine());
  12.  
  13.             int x = 2;
  14.  
  15.             Console.WriteLine("A 2 hatvanyai, amelyek kisebbek mint " + a);
  16.             while (x <= a)
  17.             {
  18.                 Console.WriteLine("{0}", x);
  19.                 x *= 2;
  20.             }
  21.         }
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement