write the program for prime numbers?
Answer Posted / paartha
include<stdio.h>
#include<conio.h>
void main()
{
int a,i , b,flag=0,no;
clrscr();
for(no=2;no<100;no++)
{
for(i=2;i<no;i++)
{
b=no%i;
if(b==0)
{
flag=1;
break;
}
else
{
flag=0;
}
}
if(flag!=1)
{
printf("\n%d",no);
}
}
getch();
}
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
How can you be sure that a program follows the ANSI C standard?
What is the explanation for prototype function in c?
Explain how can I avoid the abort, retry, fail messages?
What is a program?
What are the types of operators in c?
can anyone please tell about the nested interrupts?
hi, which software companys will take,if d candidate's % is jst 55%?
what are the facialities provided by you after the selection of the student.
What is calloc() function?
What is s or c?
Is void a keyword in c?
What is the meaning of ?
What is the difference between c and python?
Explain what are the __date__ and __time__ preprocessor commands?
Why static is used in c?