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 the difference between if else and switchstatement
What is the difference between functions abs() and fabs()?
What does the c in ctime mean?
Where static variables are stored in memory in c?
What is c programing language?
What is c method?
Write a program to print factorial of given number without using recursion?
How are strings stored in c?
What is 02d in c?
Where does the name "C" come from, anyway?
What is c language used for?
in iso what are the common technological language?
Is there a built-in function in C that can be used for sorting data?
How does #define work?
What is the code for 3 questions and answer check in VisualBasic.Net?