Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the use of static variable in c?

1102


Once I have used freopen, how can I get the original stdout (or stdin) back?

1084


Explain the difference between malloc() and calloc() function?

1063


Why string is used in c?

1019


What is nested structure?

1061


Explain the process of converting a Tree into a Binary Tree.

2688


Is null equal to 0 in sql?

1163


What is an endless loop?

1287


What is the difference between text files and binary files?

1362


what is the function of pragma directive in c?

1134


Write a program to identify if a given binary tree is balanced or not.

1182


When can a far pointer be used?

1044


List the difference between a "copy constructor" and a "assignment operator"?

1026


write a program for the normal snake games find in most of the mobiles.

2269


What is the advantage of an array over individual variables?

1250