VelizarAvramov

07. Divisible by 3

Jul 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. Write a program, which prints all the numbers from 1 to 100, which are divisible by 3. You have to use a single for loop. The program should not receive input.
  2. using System;
  3.  
  4. namespace _07._Divisible_by_3
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             for (int i = 3; i <= 100; i += 3)
  11.             {
  12.                 Console.WriteLine(i);
  13.             }
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment