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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

how to display xisheet in list box in c# .net

1622


what is c sharp dotnet

1734


What is the difference between CLEAR & RESET and OPEN & CLOSE OPCOEDS(USING RPG/400).wheare we can use this?can any body tell me in real time senario with example please?

1565


How to know we are in home page of a web application using QTP

1996


What is diffrent between Method and and function in c#

1530






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

1621


1.Mutating table

1378


what is d main diff between the java and .net framework

1542


I want to insert date in the form of yyyy-mm-dd... if any changes happen while inserting date format want to show error meg...any one can solve this..??

1655


there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box. eg: 3 box contain stick as:1,1,1. if u take 1 stick from 3rd numbred box you will any how win the match.

2422


Explain polymorphism. Provide an example.

616


For a binary tree with n nodes, How many nodes are there which has got both a parent and a child?

3180


1) How can u create the table?

1369


purpose of abstraction and interface

1523


how to work search engine? plz detail answer me.

1483