write the program for prime numbers?
Answer Posted / priyanka chauhan
// prime no series. //
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("Enter the no: ");
scanf("%d",&n);
printf("\n");
for(i=1;i<=n;i++)
{
for(j=2;j<=i-1;j++)
{
if(i%j==0)
break;
}
if(j==i)
printf("%d ",j);
}
getch();
}
| Is This Answer Correct ? | 173 Yes | 84 No |
Post New Answer View All Answers
Why c is procedure oriented?
Why is c so powerful?
What are the advantages and disadvantages of a heap?
What is the correct code to have following output in c using nested for loop?
What is p in text message?
Explain how do you override a defined macro?
Is python a c language?
Can an array be an Ivalue?
How is pointer initialized in c?
What does 2n 4c mean?
Why do we write return 0 in c?
Is it better to bitshift a value than to multiply by 2?
What is the stack in c?
What is typedef example?
What is a stream in c programming?