0% found this document useful (0 votes)
70 views1 page

Practical No 6 (JPR)

This program uses a do-while loop to display the numbers from 1 to 50. It initializes an integer variable n to 1, prints n, increments n by 1, and repeats this in the do block while n is less than or equal to 50, displaying all numbers up to 50.

Uploaded by

spidermakdi5324
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views1 page

Practical No 6 (JPR)

This program uses a do-while loop to display the numbers from 1 to 50. It initializes an integer variable n to 1, prints n, increments n by 1, and repeats this in the do block while n is less than or equal to 50, displaying all numbers up to 50.

Uploaded by

spidermakdi5324
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

PRACTICAL NO 6

a) WAP to display number 1 to 50 using do-while loop:-

class wloop
{
public static void main(String args[])
{
int n=1;
do
{
System.out.print(" "+n);
n++;
}
while(n<=50);
}
}

You might also like