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

hii I inntrested abt scjp certification but i dont knw abt scjp plz send details abt scjp exam and syllabus.

1483


smal talk is pure object oriented or not?

1598


I have try to write a record in a TDQ from a fle.... what are the steps to do... can anybody plz come with a solution

2311


1. Consider the following input and generate the object code using single pass assembler. JOHN START 0 USING *,15 L 1,FIVE A 1,FOUR ST 1,TEMP FOUR DC F’4’ FIVE DC F’5’ TEMP DS ‘F END

2466


What ports must be open for DCOM over a firewall? What is the purpose of Port 135?

7308






can any one suggestion me present which course(except java,.net) has huge demand in the market?

1713


it is a language or tools?

1719


what are other resources are needed for this mantis?

1609


write the a cl program with the following specification A. Accept 2 parameters-date and date type B. if date type is J then convert date to *MDY format C. if date type is M convert date to *JUL format 4.send a program message with the value of converted date Please explain for each with coding?

2287


Write a shell program where you enter a number which corresponds to K.M. Find out the corresponding values in m, cm, inches, and feet. Hints:- 1 k.m= 1000 m 1 m= 100 cm 1 inches= 2.54 cm. 1 feet= 12 inches

1624


1.Mutating table

1497


Difference between debugging, running, executing of an application

3587


What is the difference beween joblib and steplib statements

1883


I HAVE DONE TESTING TOOLS COURSE,NOW I AM FRESHER,I AM NOT GETTING ANY CALLS,I WANT TO DO THE PROJECT ,WHERE I HAVE TO MEET TO DO THE PROJECT,I AM GOING WITH FAKE EXPERIENCE,SO WHAT I HAVE TO DO.

4509


5. Which of the following can you do with DB2 Express- C? Query databases with SQL Query databases with XML using XQuery and XPath Use SQL in Xquery and Xquery in SQL All of the above

2240