write the program for prime numbers?
Answer Posted / paps
#include<stdio.h>
void main()
{
int a=1,i,j,b,n;
printf("enter the range\n");
scanf("%d",&n);
printf("prime number series between 1 to %d:n");
printf("%d",a);
while(i<=n)
{
for(j=2;j<i;j++)
{
b=i%j;
if(b==0)
break;
}
if(i==j)
printf("%d",i);
i++;
}
getch();
}
| Is This Answer Correct ? | 8 Yes | 4 No |
Post New Answer View All Answers
What is difference between structure and union?
What does the format %10.2 mean when included in a printf statement?
What is the purpose of void pointer?
Why main function is special give two reasons?
How will you find a duplicate number in a array without negating the nos ?
What are the different types of linkage exist in c?
Explain the bubble sort algorithm.
Which header file is used for clrscr?
The statement, int(*x[]) () what does in indicate?
Do you know the purpose of 'register' keyword?
What is data structure in c language?
What are the benefits of c language?
what is stack , heap ,code segment,and data segment
How can you avoid including a header more than once?
explain what is an endless loop?