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


Please Help Members By Posting Answers For Below Questions

Explain Basic concepts of C language?

647


What is the purpose of 'register' keyword in c language?

630


What is null pointer constant?

596


What is pivot in c?

569


What does main () mean in c?

616






What is the scope of static variable in c?

537


What is the difference between a string and an array?

709


How can I find out how much free space is available on disk?

631


Explain how do you determine whether to use a stream function or a low-level function?

631


what is ur strangth & weekness

1821


Write a program which returns the first non repetitive character in the string?

605


Wt are the Buses in C Language

2753


What does c in a circle mean?

584


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

15508


Is using exit() the same as using return?

680