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
How do I read the arrow keys? What about function keys?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Is stack a keyword in c?
Differentiate between declaring a variable and defining a variable?
What is time complexity c?
What is the heap?
What is an example of structure?
Which is the memory area not included in C program? give the reason
What is the default value of local and global variables in c?
what is bit rate & baud rate? plz give wave forms
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
Which is better malloc or calloc?
Do string constants represent numerical values?
What are operators in c?
What is return in c programming?