write the program for prime numbers?
Answer Posted / harpreet dhillon
#include<stdio.h> \\harpreetdhillon7@gmail.com
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("enter any number which you want to check");
scanf("%d",&n);
for(i=2;i<=n-1;i++)
{
if(n%i==0)
{
printf("not a prime number\n");
break;
}
else
{
printf("prime number\n");
break;
}
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
write a program to display all prime numbers
explain what is fifo?
Explain the process of converting a Tree into a Binary Tree.
find the sum of two matrices and WAP for it.
What is dynamic memory allocation?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
What are the valid places to have keyword “break”?
What is meant by type specifiers?
What is array in C
Is c language still used?
How to Throw some light on the splay trees?
Write a program with dynamically allocation of variable.
What is a constant?
What is a dynamic array in c?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above