write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / abhay
#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 ? | 291 Yes | 108 No |
Post New Answer View All Answers
how many errors in c explain deply
how to build a exercise findig min number of e heap with list imlemented?
What are the applications of c language?
What is static volatile in c?
What are the differences between Structures and Arrays?
When we use void main and int main?
string reverse using recursion
Write a factorial program using C.
Define VARIABLE?
What are the uses of a pointer?
What is the maximum length of an identifier?
What is pre-emptive data structure and explain it with example?
Is it fine to write void main () or main () in c?
Is flag a keyword in c?
number of times a digit is present in a number