C Use Loop Statement Write Program Prints Even Numbers 15 31 Q37143542

C#

Use a while loop and if statement to write a programthat prints all the even numbers between 15 and 31


Solution


using System;public class PrintEvens{ public static void Main(string[] args) { int i = 15; Console.WriteLine(“Even numbers between 15 and 31 are”); while (i <= 31) { if (i % 2 == 0)

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.