write the program for prime numbers?
Answer Posted / akhilesh singh(m.c.a-iisem ois
main()
{
int i,j=2,ch=0;
clrscr();
printf("\nENTER ANY NUMBER");
scanf("%d",&i);
while(j<=i/2)
{
if(i%j==0)
{
printf("%d IS NOT PRIME",i);
ch=1;
break;
}
else
{
j++;
}
}
if(ch==0)
{
printf("%d IS PRIME",i);
}
}
Is This Answer Correct ? | 1243 Yes | 384 No |
Post New Answer View All Answers
How can I dynamically allocate arrays?
What does typeof return in c?
Write a program for finding factorial of a number.
When is a void pointer used?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
Why is c faster?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
What is meant by keywords in c?
Explain main function in c?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
What is the significance of scope resolution operator?
What is meant by int main ()?
what is ur strangth & weekness
What does stand for?
Explain enumerated types.