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

#include<iostream.h>
void main()
{
int n,a;
cout<<"enter the limit";
cin>>n;
for(i=1;i<=n;i++}
{
if(i=1)
{
cout<<"1 is neither a prime nor a composite no";
}
else if(i%1==0|i%i==0)
{
cout<<i<<"is a prime number";
}
}
}

Is This Answer Correct ?    63 Yes 165 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is = symbol different from == symbol in c programming?

1051


Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?

2694


What do you mean by a local block?

1087


What is the difference between declaring a variable by constant keyword and #define ing that variable?

3379


What are local static variables?

1155


Explain what does the format %10.2 mean when included in a printf statement?

1367


Does c have function or method?

1007


In a switch statement, explain what will happen if a break statement is omitted?

1077


What is build process in c?

1160


how to build a exercise findig min number of e heap with list imlemented?

2077


What are the application of c?

1102


What are the ways to a null pointer can use in c programming language?

1137


Why void main is used in c?

1053


What does == mean in texting?

1312


What do you know about the use of bit field?

1050