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 / shravani

void main()
{
int i,num=1;
clrscr();

while(num<=100)
{ i=2; while(i<=num)
{ if(num%i==0)
break;
i++; }
if(i==num)
printf("\n%d is Prime",num);
num++;
}
getch();
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are called c variables?

1058


formula to convert 2500mmh2o into m3/hr

993


Why does everyone say not to use scanf? What should I use instead?

1422


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

1499


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

1050


Is it acceptable to declare/define a variable in a c header?

1118


What are the advantages of using linked list for tree construction?

1085


When is the “void” keyword used in a function?

1497


How to delete a node from linked list w/o using collectons?

2778


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

1062


Who is the main contributor in designing the c language after dennis ritchie?

999


Describe the header file and its usage in c programming?

1069


With the help of using classes, write a program to add two numbers.

1035


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

1159


Can you define which header file to include at compile time?

1022