answersLogoWhite

0

/*the program to print prime no from 1 to 300*/

#include<stdio.h>

#include<conio.h>

void main()

{

int i,j;

clrscr();

printf("The prime numbers from 1 to 300 are\n");

for(j=2;j<=300;j++)

{

for(i=2;i<=j/2;i++)

if(j%i==0)

break;

if(i>j/2)

{

printf("%d ",j);

}

}

}

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach

Add your answer:

Earn +20 pts
Q: Write a C program to find the prime numbers from 1 to 300?
Write your answer...
Submit
Still have questions?
magnify glass
imp