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
Function calling procedures? and their differences? Why should one go for Call by Reference?
Explain what are global variables and explain how do you declare them?
Differentiate between the expression “++a” and “a++”?
Explain do array subscripts always start with zero?
Which is the best website to learn c programming?
What are loops c?
What is difference between structure and union in c?
Explain what are multibyte characters?
What is advantage of pointer in c?
What are the applications of c language?
What is a node in c?
Is int a keyword in c?
Why is this loop always executing once?
Can we replace the struct function in tree syntax with a union?
What are the data types present in c?