A prime number is a number which is divisible only by itself
and 1. Examples of the first few primes are 2, 3, 5, 7, 11.
Consider writing a program which can generate prime numbers
for you. Your program should read in and set a maximum prime
to generate and a minimum number to start with when looking
for primes.
This program should be able to perform the following tasks:
1. Read the maximum number from user (keyboard input) to
look for primes. The program should not return any primes
greater than this number.
2. Read the minimum number from user (keyboard input) to
look for primes. The program should not return any primes
less than this number.
3. Generate and print out every prime number between the
maximum prime and minimum number specified by the user.


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C++ General Interview Questions

What is :: operator in c++?

0 Answers  


Consider a c++ template funtion template<class T> T& Add(T a, T b){return a+b ;} if this function is called as T c = Add("SAM", "SUNG"); what will happen? What is the problem in the template declaration/ How to solve the problem.

7 Answers   LG, Samsung,


What is meant by a delegate?

0 Answers  


If a header file is included twice by mistake in the program, will it give any error?

0 Answers  


Write about a nested class and mention its use?

0 Answers  






What are member functions used in c++?

0 Answers  


What is a pointer with example?

0 Answers  


declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator

0 Answers  


What are c++ templates used for?

0 Answers  


How is c++ used in the real world?

0 Answers  


Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?

0 Answers  


What is an adjust field format flag?

0 Answers  


Categories