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
Explain Basic concepts of C language?
What is the purpose of 'register' keyword in c language?
What is null pointer constant?
What is pivot in c?
What does main () mean in c?
What is the scope of static variable in c?
What is the difference between a string and an array?
How can I find out how much free space is available on disk?
Explain how do you determine whether to use a stream function or a low-level function?
what is ur strangth & weekness
Write a program which returns the first non repetitive character in the string?
Wt are the Buses in C Language
What does c in a circle mean?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
Is using exit() the same as using return?