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

#include<iostream>
using namespace std;
int main()
{
int num,i,j,flag;
cout<<"enter the no. up2 which u want prime no's:";
cin>>num;
for(i=2;i<=num;i++)
{
flag=1;
for(j-2;j<i/2;i++)
{
if(i%j==0)
flag=0;
}
if(flag==1)
cout<<i<<" ";
}
}

Is This Answer Correct ?    34 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are register variables? What are the advantage of using register variables?

1226


What is the meaning of typedef struct in c?

1112


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

2306


What is the use of f in c?

1028


Simplify the program segment if X = B then C ← true else C ← false

3058


what is bit rate & baud rate? plz give wave forms

2026


What is the use of pointers in C?

1130


Why main is used in c?

1120


Write a program to swap two numbers without using third variable in c?

1178


Explain void pointer?

1091


How to implement a packet in C

2928


What is sizeof int?

1150


What is self-referential structure in c programming?

1275


What is far pointer in c?

1385


What is a program flowchart and how does it help in writing a program?

1184