write the program for prime numbers?
Answer Posted / vijay bharti
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i,count=0;
clrscr();
for(num=1;num<=300;num++)
{
for(i=2;i<=num/2;i++)
{
if(num%i!=0)
count=count+1;
}
}
printf("number of prime numbers between 1 to 300 are : %d",count);
getch();
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What does d mean?
what is recursion in C
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
Explain what are binary trees?
Are the outer parentheses in return statements really optional?
Explain can static variables be declared in a header file?
What is meant by high-order and low-order bytes?
What would be an example of a structure analogous to structure c?
What is line in c preprocessor?
What are the uses of a pointer?
What is LINKED LIST? How can you access the last element in a linked list?
#include
How can you be sure that a program follows the ANSI C standard?
What is variable in c example?
What are the 4 data types?