write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / sureshbobra
#include<stdio.h>
#include<conio.h>
main()
{
int flag,i,j;
clrscr();
for(i=1;i<=100;i++)
{
flag=0;
for(j=2;j<=i;j++)
{
if(i%j==0)
{
flag++;
}
}
if(flag==1)
printf("%d\t",i);
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 6 No |
Post New Answer View All Answers
What is the use of static variable in c?
Once I have used freopen, how can I get the original stdout (or stdin) back?
Explain the difference between malloc() and calloc() function?
Why string is used in c?
What is nested structure?
Explain the process of converting a Tree into a Binary Tree.
Is null equal to 0 in sql?
What is an endless loop?
What is the difference between text files and binary files?
what is the function of pragma directive in c?
Write a program to identify if a given binary tree is balanced or not.
When can a far pointer be used?
List the difference between a "copy constructor" and a "assignment operator"?
write a program for the normal snake games find in most of the mobiles.
What is the advantage of an array over individual variables?