Computer Science, asked by garvit1294, 11 months ago

write a program to print a table of 5 using do while loop in java​

Answers

Answered by GeN21
1

class table

{

public static void main( )

{

int a=5; int I=1;

do

{

System.out.println(a+"×"+I=(a*I));

I++;

}while(I<10);

}

}


Anonymous: he asked for while loop
Anonymous: but u used do while
GeN21: do while
GeN21: yes
garvit1294: i asked do while
GeN21: the question says do while
GeN21: good welcome to be of help.
garvit1294: np i will accept both of them
Answered by Anonymous
3
class Table
{
public static void main()
{
int n=1;
while(n<=10)
{
System.out.println(5*n);
n++;
}
}
}
HOPE THIS HELPS...
pls mark as BRAINLIEST!
:)
Similar questions