Computer Science, asked by shashwatbhai6, 3 months ago

Write a program to print all prime numbers between 1 and 100 in java with output​

Answers

Answered by pragatibhatt2922
1

Answer:

Explanation:

class Prime. {

public static void main(String arg[]) {

int i,count; System. out. print("Enter n value : ");

Scanner sc=new Scanner(System. in); int n=sc. nextInt();

System. out. println("Prime numbers between 1 to "+n+" are "); for(int j=2;j<=n;j++)

{ count=0;

for(i=1;i<=j;i++) {

if(j%i==0) {

Answered by sneham211117
0

Explanation:

hope this answer helps you.

happy learning ✌️☺️✌️❤️

Attachments:
Similar questions