C# Program to Print All the Multiples of 17 which are Less than 100

This is a C# Program to print all the multiples of 17 which are less than 100.

Problem Description

This C# Program Prints all the Multiples of 17 which are Less than 100.

Problem Solution

Here all the multiples of 17 are displayed.

Program/Source Code

Here is source code of the C# Program to Print all the Multiples of 17 which are Less than 100. The C# program is successfully compiled and executed with Microsoft Visual
Studio. The program output is also shown below.

/*
 * C# Program to Print all the Multiples of 17 which are Less than 100
 */
using System;
class program
{
    public static void Main()
    {
        int a,i;
        Console.WriteLine("Multiples of 17 are : ");
        for (i = 1; i < 100; i++)
        {
            a = i % 17;
            if (a == 0)
            {
                Console.WriteLine(i);
            }
        }
        Console.Read();
    }
}
Program Explanation

In this C# program using for loop, compute the multiples of 17 from 1 to 100. Initialize the value of ‘i’ variable as 1 and check the condition that the value of ‘i’ variable is less than 100.

advertisement
advertisement

If the condition is true then execute the statement. Compute the modulus of the value of ‘i’ variable by 17. If condition statement is used to check the value of ‘a’ variable is equal to 0. If the condition is true then execute the statement and print all the multiples of 17.

Runtime Test Cases
 
Multiples of 17 are :
17
34
51
68
85

Sanfoundry Global Education & Learning Series – 1000 C# Programs.

Note: Join free Sanfoundry classes at Telegram or Youtube
If you wish to look at all C# Programming examples, go to 1000 C# Programs.

If you find any mistake above, kindly email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.