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
Which of these functions is safer to use : fgets(), gets()? Why?
What is the difference between malloc() and calloc()?
What is a stream water?
Are there any problems with performing mathematical operations on different variable types?
What is the scope of local variable in c?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
Explain what are header files and explain what are its uses in c programming?
What do you mean by command line argument?
what are the facialities provided by you after the selection of the student.
What is the importance of c in your views?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
int far *near * p; means
Explain can you assign a different address to an array tag?
When is a null pointer used?
What is a double c?