Computer Science, asked by Tanu444, 10 months ago

2 programs based on while loop for java

Answers

Answered by dhruvinkachhadia
2

Don't know whySimple Syntax based example:-

class WhileLoopSyntax {

public static void main(String args[]){

int i=10;

while(i>1){

System.out.println(i);

i--;

}

}

}

While Loop for Infinite Display:-

class WhileLoopInfinite {

public static void main(String args[]){

int i=10;

while(i>1)

{

System.out.println(i);

i++;

}

}

}

Hope the answer helped you.

If you find it useful,

Kindly mark it as Brainliest.

Similar questions