Computer Science, asked by Anitanirola221, 1 year ago

Write a program to display a infinite loop provide the easy example

Answers

Answered by kalyaniprasad8
2

//code snippet for infinite loop

int i=1;

while(i!=0)

{

System.out.println("Infinite!");

}


kalyaniprasad8: Please mark brainliest
kalyaniprasad8: Mark brainliest
kalyaniprasad8: Plz
Answered by BrainlyPromoter
2
We are writing a program using Java, hope you have no issues with it.

Sample program to display infinite loop by printing a specific number:
public class BrainlyPromoter
{
public static void main(String args[])
{
for(int n = 1 ; n > 0 ; n++)
{
System.out.println("1");
}
}
}

Sample program to display infinite loop by printing a specific alphabet:
public class TechyPrince
{
public static void main(String brain [])
{
int n = 1;
while(n > 0)
{
System.out.println("A");
n++;
}
}
}

Sample program to display infinite loop by printing numbers upto infinity:
public class BrainlyLegend
{
public static void main(String args[])
{
int n = 1;
do
{
System.out.println(n);
n++;
}
while(n > 0)
}
}

Similar questions