Write an infinite loop using do while condition.


import java.util.*;

 

public class Solutions {

   public static void main(String args[]) {

      do {

 

      } while(true);

   }   

}



Share to whatsapp

More Questions from Java Basic Codes Module 0

Enter 3 numbers from the user & make a function to print their average.


View

Find the maximum & minimum number in an array of integers.

[HINT : Read about Integer.MIN_VALUE & Integer.MAX_VALUE in Java]


View

Take an array of names as input from the user and print them on the screen.


View

Write a program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros entered. 


View

Write a function to calculate the factorial of a number.


View

Write a function to print the sum of all odd numbers from 1 to n.


View

Write a function which takes in 2 numbers and returns the greater of those two.


View