) Write a program to display all the Even numbers from 1 to 100 using For loop.
Answers
Answered by
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
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
CBSE BOARD X,
1 month ago
English,
1 month ago
Math,
1 month ago
Math,
2 months ago
Math,
9 months ago