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 are pointers? What are stacks and queues?
What is signed and unsigned?
Explain how can I manipulate strings of multibyte characters?
largest Of three Number using without if condition?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
Can you please explain the difference between malloc() and calloc() function?
Can true be a variable name in c?
What are the 3 types of structures?
Is calloc better than malloc?
Explain the difference between structs and unions in c?
What is switch in c?
How will you delete a node in DLL?
What is nested structure?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
Do you have any idea about the use of "auto" keyword?