write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
int m,flag;
printf("enter the numbers upto which you wannt to find the prime numbers :");
scanf("%d",&m);
for(int i=1;i<=m;i++)
{
flag=1;
for(int j=2;j<=i/2;j++)
{
if(i%j==0)
flag=0;
}
if(flag==1)
printf("\n%d",i);
}
getch();
}
thank u
| Is This Answer Correct ? | 49 Yes | 24 No |
Post New Answer View All Answers
p*=(++q)++*--p when p=q=1 while(q<=6)
Does sprintf put null character?
What is output redirection?
What is scope rule in c?
Can one function call another?
What is calloc in c?
What is static volatile in c?
What are the similarities between c and c++?
Do you know what are the properties of union in c?
What does %c do in c?
Explain the use of bit fieild.
find the sum of two matrices and WAP for it.
Write a program to use switch statement.
What are the benefits of organizational structure?
Is c easier than java?