Java Program to Print 1 to 100 Numbers without using Loop

preview_player
Показать описание
Write a Java program to print 1 to 100 numbers without using loop (for and while loop).

Рекомендации по теме
Комментарии
Автор

sir solving your whole java playlist problems is it enough for sit in placementss i think 300+ videos u have posted on java dsa problems I think we can build our logic through this

ajajith
Автор

i = 0
while i<100:
if i%10 == 0:
continue;
else:
print(i)
i = i + 2

skch
Автор

The most easy way is here
class prime_nos
{
void display()
{
for(int no=1;no<=100;no++)
{
if(is_prime(no))
System.out.println(no+"is a prime number");
}
}
//Checking the number is prime or not
boolean is_prime(int num)
{
int di=0, ctr=0;
for(di=1;di<=num;di++)
{
if(num%di==0)
ctr++;
}
if(ctr==2)
return true;
else
return false;
}
}

For more coding please inform

mdtauseefakhtar