Computer Science, asked by sid320, 2 months ago

Write a program to display all even numbers from 2 to 100 using for loop.​

Answers

Answered by kruthikashetty016
1

Explanation:

#include <iostream>

using namespace std;

int main() {

int i;

/* Run a loop from 1 to 100. */

for(i = 1; i < = 100; i++){

/* If number is divisible by 2. */

if(i % 2 == 0) {

cout << i <<" ";

}

}

return 0;

}

Similar questions