package com.company;
import java.util.Scanner;
public class Program24 {
public static void main(String[] args) {
Scanner put = new Scanner(System.in);
System.out.println("please enter the number of terms:");
int n=put.nextInt();
int i=1;
while(i<=n)
{
System.out.println("enter a number:");
int num=put.nextInt();
i++;
}
}
}
Hi Friends ! You are on HR Developers website. Here you can find the codes of different languages like c ,c++ , java, pyton and many other languages.
Friday, June 18, 2021
program in Java to display the natural numbers using while loop (Java) (187)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment