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 are the advantages of Macro over function?
What is pointer in c?
What is extern variable in c with example?
What is volatile variable in c?
What are structures and unions? State differencves between them.
What is difference between && and & in c?
What is boolean in c?
Explain what is a 'locale'?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
What is clrscr ()?
How do you construct an increment statement or decrement statement in C?
Is it valid to address one element beyond the end of an array?
Is c still used?
What are two dimensional arrays alternatively called as?
How many types of errors are there in c language? Explain