Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

if else if else for loop

using System;
 
class NumbersNotDivisibleByThreeAndSeven
{
    static void Main()
    {
        Console.WriteLine("Please enter your number: ");
        int n = int.Parse(Console.ReadLine());
 
        for (int i = 1; i <= n; i++)
        {
            if (i % 3 == 0)
            {
                continue;
            }
            else if (i % 7 ==0)
            {
                continue;
            }
            Console.Write("{0} ", i);
        }
        Console.WriteLine();
    }
}
Source by forum.tutorials7.com #
 
PREVIOUS NEXT
Tagged: #loop
ADD COMMENT
Topic
Name
3+9 =