write a program in Java to print 2,4,6,8,....,100 by using for (), while() and do-while () loops.
Answers
Answered by
4
Answer:
for(i = 2; i<=100; i+=2)
System.out.println(i);
i=2;
while(i!=100) {
System.ou.println(i);
i+=2;
}
i=2;
do {
System.ou.println(i);
i+=2;
} while(i!=100);
hope it helped you sweety ❤️
Answered by
5
public class Even
{
public static void main(String args[])
{
int = i;
for(i=100;i>=2;i=i-2)
System.out.println(i);
}
}
BY
ρяเýลиรђµ
Similar questions