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
What is sizeof int in c?
What is the difference between the local variable and global variable in c?
what is the syallabus of computer science students in group- 1?
What is an lvalue?
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
What is data structure in c and its types?
What is c preprocessor mean?
Where can I get an ansi-compatible lint?
Is stack a keyword in c?
Why is event driven programming or procedural programming, better within specific scenario?
What is the purpose of type declarations?
FILE PROGRAMMING
What is a node in c?
Which one would you prefer - a macro or a function?