write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / shailesh singh
#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("2\t");
for(int i=3;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 ? | 0 Yes | 2 No |
Post New Answer View All Answers
Why are algorithms important in c program?
What is a example of a variable?
Explain what’s a signal? Explain what do I use signals for?
Is it possible to initialize a variable at the time it was declared?
Is a pointer a kind of array?
Is there a built-in function in C that can be used for sorting data?
What is hashing in c language?
When c language was developed?
What is the difference between struct and union in C?
What is the difference between fread and fwrite function?
Why is it that not all header files are declared in every C program?
Why is c so important?
What is the c value paradox and how is it explained?
#include
What is meant by inheritance?