write the program for prime numbers?
Answer Posted / ashwini kumar nayak
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int c,i,n;
c=0;
printf("Enter the number");
scanf("%d",&n);
if(n==1)
printf("Number is the special number");
else
{
for(i=2;i<n;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1)
printf("prime");
else
printf ("not a prime");
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can we access array using pointer in c language?
What is chain pointer in c?
which type of aspect you want from the student.
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
How arrays can be passed to a user defined function
What is call by reference in functions?
What is uint8 in c?
Where static variables are stored in c?
What is the difference between procedural and declarative language?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
What is atoi and atof in c?
How can I write functions that take a variable number of arguments?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
How can I call a function with an argument list built up at run time?