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

I m Abdullah Ansari compleated MCA from Jamia Hamdard,i have appeared the test of IBM on 2 august at oxford college of engineering Bangalore.waiting for hr round.. This is the first round for IBM.02/08/08 Paper consists of 4 sections 15 questions from matrices(time very less but no negative marking). 25 questions from series completion section (this section is very easy but negative marking) 15 questions from aptitude(little bit tough time limit 15 minute negative marking) 4th section is from computer science (c,c++,operating system,digital electronics ,basic question..) result came at 3 o'clock.i was selected... In interview they asked questions like 1 they asked about final yr project.. 2 what are dynamic and static memory location? 3 linked list and array difference between them. 4 what is function ? what is difference betwen function and inline function? 5 about structure 6 about binary tree, traversal, call by value. 7 storage class and many more basic questions..

0 Answers   IBM,


Please describe an example where you used object orientation in one of your programs.

0 Answers  


could you please tell me how to draw the calibration curve for HPLC {the software which we are using}?

0 Answers  


iam confused among testing ,.net and java. can anybody help me.

0 Answers  


differences between qtp10.0 and 11.0 ?

0 Answers  


In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?

0 Answers  


Write a program to find whether a given number is prime or not.

0 Answers   Syntel, Visa,


sample code for data transfer between two r/2 systems and r/3 systems?

0 Answers  


What do you meant by Runtime Polymorphism?

2 Answers   Persistent,


Define Form modules, Class modules and Standard modules

0 Answers   Global Hunt,


if we want to move all the items that are already added in a combobox into an empty list box or vice-versa then how can it possible in vb or C# ?

1 Answers  


What for decision coverage and modified condition decision coverage are used? Wat is the difference between them?

0 Answers  


Categories