write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / siva
#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("1\t");
for(int i=1;i<=100;i++)
{
flag=0;
for(x=2;x<=i;x++)
{
if(i%x==0)
{
flag=1;
break;
}
else
continue;
}
if(i==x)
printf("%d\t",i);
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Write a program to generate the Fibinocci Series
What are valid operations on pointers?
develop algorithms to add polynomials (i) in one variable
What is the use of bitwise operator?
What are header files why are they important?
Are there any problems with performing mathematical operations on different variable types?
What is the purpose of type declarations?
What is the difference between #include and #include 'file' ?
Explain what are run-time errors?
What is wrong with this initialization?
Is exit(status) truly equivalent to returning the same status from main?
shorting algorithmS
what is the structure pointer?
Who is the main contributor in designing the c language after dennis ritchie?
Why calloc is better than malloc?