Computer Science, asked by PALAKJAISWAL79, 7 months ago

plz help fast!!!! plz don't copy paste or else I'll report!! ​

Attachments:

Answers

Answered by shreekeertan
1

Answer:

class JavaExample {

public static void main(String args[]) {

int n = 100;

System.out.print("Even Numbers from 1 to "+n+" are: ");

for (int i = 1; i <= n; i++) {

//if number%2 == 0 it means its an even number

if (i % 2 == 0) {

System.out.print(i + " ");

}

}

}

}

Similar questions