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
Explain what is operator promotion?
What is struct node in c?
Explain the use of keyword 'register' with respect to variables.
What is scanf_s in c?
where are auto variables stored? What are the characteristics of an auto variable?
Why c language is called c?
What are the types of type specifiers?
What is the use of a ‘ ’ character?
Is it valid to address one element beyond the end of an array?
Find MAXIMUM of three distinct integers using a single C statement
How will you delete a node in DLL?
What is indirection?
What is the difference between ++a and a++?
What are the two forms of #include directive?
Write a program to generate random numbers in c?