Computer Science, asked by bhaktamahakud7338, 2 months ago

) Write a program to display all the Even numbers from 1 to 100 using For loop.​

Answers

Answered by vaishnavirankhamb6
1

Answer:

public class DisplayEvenNumbersExample1.

{

public static void main(String args[])

{

int number=100;

System.out.print("List of even numbers from 1 to "+number+": ");

for (int i=1; i<=number; i++)

Answered by Ujjwal202
3

Correct Question :

Write a program to display all the Even numbers from 1 to 100 using For loop.

Programming :

Using c++ :-

#include<iostream.h>

void main()

{

for(int i=2; i<=100; i+=2)

{

cout<< i;

cout<<endl;

}

}

OUTPUT :-

2

4

6.....100

You can also use java, python to program above question.

Similar questions