mjc65

uneven

Apr 22nd, 2020
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.29 KB | None | 0 0
  1. int counter = 0;
  2. Console.WriteLine("Printing all the uneven numbers from 0 to 100:");
  3.  
  4. for (int x = 0; x <= 100; x++)
  5.     {  
  6.         if(x%2!=0)
  7.         {
  8.             counter++;
  9.             Console.Write("Hi There!");
  10.         }
  11.     }
  12.  
  13. Console.WriteLine("\nPrinted 'Hi There' to the Console {0} times", counter);
  14. Console.ReadKey();
Advertisement
Add Comment
Please, Sign In to add comment