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
What is c programming structure?
What are the 4 types of functions?
Can the “if” function be used in comparing strings?
C program to find all possible outcomes of a dice?
Is there sort function in c?
How will you declare an array of three function pointers where each function receives two ints and returns a float?
Why & is used in scanf in c?
Write a program in c to replace any vowel in a string with z?
What functions are used for dynamic memory allocation in c language?
What is the difference between text and binary i/o?
By using C language input a date into it and if it is right?
What are the types of bitwise operator?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
Why does everyone say not to use gets?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none