write the program for prime numbers?
Answer Posted / pritam neogi
#include<stdio.h>
#include<conio.h>
void main()
{
int no,i,count=0;
clrscr();
printf("enter the no");
scanf("%d",&no);
for(i=1;i<=no;i++)
{
if(no%i==0)
{
count=count+1;
}
}
if(count<=2)
{
printf("this is prime no");
}
else
{
printf("this is not prime");
}
getch();
}
Is This Answer Correct ? | 32 Yes | 16 No |
Post New Answer View All Answers
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
What is a struct c#?
to find the closest pair
How to create struct variables?
Explain what is a pragma?
Compare interpreters and compilers.
Can you please explain the difference between exit() and _exit() function?
Difference between Function to pointer and pointer to function
Which header file is essential for using strcmp function?
Who is the main contributor in designing the c language after dennis ritchie?
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
how many errors in c explain deply
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
What is optimization in c?
How many levels of pointers can you have?