write the program for prime numbers?
Answer Posted / love
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int num, i;
printf("enrer the value");
scanf("%d",&num);
i=2;
while(i<=num-1)
{
if(num%i==0)
{
printf("not a prime");
break;
}
i++;
}
if(i==num)
printf("prime");
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the maximum no. of arguments that can be given in a command line in C.?
Can we assign integer value to char in c?
What are the ways to a null pointer can use in c programming language?
What is the difference between int main and void main?
What is the use of header?
Which is the best website to learn c programming?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
what do you mean by inline function in C?
Why c is called top down?
difference between native and cross compilers
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What are valid operations on pointers?
Is it fine to write void main () or main () in c?
What is wild pointer in c with example?