write the program for prime numbers?
Answer Posted / noble
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter any number:");
scanf("%d",&a);
for(b=2;b<=a-1;b++)
{
if(a%b==0)
break;
}
if(a==b)
{
printf("%d is prime number",a);
}
else
{
printf("%d is not prime number",a);
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is data types?
What is call by reference in functions?
Explain heap and queue.
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
Write a code to generate a series where the next element is the sum of last k terms.
Why is extern used in c?
What are valid signatures for the Main function?
What is the purpose of 'register' keyword in c language?
Explain the properties of union. What is the size of a union variable
Is stack a keyword in c?
Is flag a keyword in c?
What does p mean in physics?
What is New modifiers?
How old is c programming language?
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