Java program to print all the prime numbers between 1 and 100

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

I Love your channel and explanations. It's been helping me a lot. Thank you.

punk
Автор

The number of lines in your program is to much due to which the program may become slow.


import java.util.Scanner;

public class EvenOdd2
{
public static void main(String[] args)
{
int num;
System.out.println("Enter any number");
Scanner sc=new Scanner(System.in);
num=sc.nextInt();
if(num%2==0)
System.out.println("Even Number");
else
System.out.println("Number Odd" );
}
}

chandankumarsingh
Автор

Are bhai tune isprime = false
If or else dono me lia hai tho else ka matlab kya hai bhai

ganeshdhakane
Автор

SIR YE BINA METHOD KE KARO...HAR JAGA METHOD NHI LAGA SAKTE

afk