write the program for prime numbers?
Answer Posted / pratibha
#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 ? | 17 Yes | 14 No |
Post New Answer View All Answers
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is the use of ?
Explain how can type-insensitive macros be created?
What is the difference between array and pointer in c?
Do variables need to be initialized?
What is FIFO?
How can I open a file so that other programs can update it at the same time?
Is a house a shell structure?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
What is #line used for?
what is the difference between class and unio?
Why can’t constant values be used to define an array’s initial size?
What are the different types of errors?
write a program to create a sparse matrix using dynamic memory allocation.
How can I make it pause before closing the program output window?