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

Given an array of size n, containing every element from 1 to n+1, except one. Find the missing element.

856


What is the use of sas software? Is sas and sap are different?

1220


how to fin top two miximum values in sql? not 2nd both max value of 1st and 2nd both have to find out

1690


How can recruiter justified that the candidate is expert in Algorithm and datastructure for Software product development ?

1714


In JCl , we have COND parameter.This holds comparison code and condition.It also has only and even parameters. ex: COND((4,GE),EVEN).what the comma mean here. is that 'and' or 'or'.

2048


I am taking the bmc control m/enterprise manager 7.0 scheduling test and just wanted to see what kind of questions they would ask or if anyone has taken the test and how long it is for how many questions?

5869


Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the number of smaller cubes on the surface. Extend this to k-dimension.

895


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

1693


diffrence between oracle apps , .NET , SAP

1820


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

1842


is it acceptable if we declare multiple exceptions in same overridden method.

2351


what will we require to build project with the help of oracle

1598


In mainframe SDSF, Can we copy the list of jobs currently executing in SDSF in to a seperate DATASET...?

2022


WHAT IS THE MEANING OF CONSTANT ...EXEEDS LENGTH LIMIT WHILE COPYING FROM PS FILE TO KSDS

1796


what is the purpose of checked Menu options

2195