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
string reverse using recursion
What is d'n in c?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
What is pass by reference in functions?
Write a program with dynamically allocation of variable.
How can I access an I o board directly?
What is sizeof array in c?
Can static variables be declared in a header file?
How can you read a directory in a C program?
What is the difference between array and linked list in c?
what is a constant pointer in C
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
Describe the modifier in c?
What language is lisp written in?
What are header files in c?