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...


WAP to print all prime nos between 1 to 100 without using user
input...pls reply within few hours...



WAP to print all prime nos between 1 to 100 without using user input...pls reply within few hours...

Answer / ashwek

/// Using C++

#include<iostream.h>
#include<conio.h>

int main(){

int temp;

cout<<" Prime number between 1 to 100 : ";
for(int i=2; i<=100; i++){
temp=0;
for(int j=2; j<i; j++){
if(i%j==0) temp = 1;
}

if(temp==0) cout<<i <<", ";
}
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

How many processes can listen on a single TCP/IP port?

3 Answers  


in IT trend mantis meant what? how to know mantis in IT trends? detail description about mantis?

0 Answers   Sacred Heart College,


what are the difference between C,C++and Java

1 Answers   Wipro,


what is difference between input parameter and output parameter.

0 Answers   NIIT,


While joining files if only two files are mentioned with jfile keyword, do we required to use join keyword????

2 Answers  


i want to open a helkp file that is txt file on link buttons click

1 Answers  


What are events in smartforms?

0 Answers   Accenture,


What sysoption determines where the macro facility searches a specific catalog for complied macro?

0 Answers   GE,


Write a program to calculate the following i want a Java program for this condition 1+4+9+16+….+100 Like this (1^2+2^2) Hint use function pow(a,b)

4 Answers   HTC,


Compare any 4 software development life cycle paradigms with each other. Indicate at least one application for each of the paradigms that are suitable to developed using that paradigm.

0 Answers  


this question is from sas:what is the difference between FILE and INFILE statements? plz explain in brief?

1 Answers  


DIFFERENCE BETWEEN BINDING LANG AND BIND DIR WHEN USING IN SERVICE PGM

0 Answers   CTS,


Categories