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 are high level languages like C and FORTRAN also known as?
Do you know the purpose of 'register' keyword?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
What is hashing in c?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
How do you construct an increment statement or decrement statement in C?
Explain the process of converting a Tree into a Binary Tree.
When a c file is executed there are many files that are automatically opened what are they files?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Tell me when would you use a pointer to a function?
What are header files in c programming?
What are reserved words with a programming language?
How can I swap two values without using a temporary?
Write the control statements in C language