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 is the code for 3 questions and answer check in VisualBasic.Net?
What is %d used for?
What is typedf?
Is c is a middle level language?
What are the features of the c language?
How can I manipulate individual bits?
What is union and structure?
Explain what is the difference between functions abs() and fabs()?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Is c object oriented?
What are the differences between Structures and Arrays?
How do you construct an increment statement or decrement statement in C?
What is ctrl c called?
What is a #include preprocessor?
Which is the best website to learn c programming?