C++/Turbo C

Advertisement


Question
hi
can you tell me a C program which prints all the prime numbers between 1 to 100

Answer
First you need to have an algorithm for printing numbers. For a small range like till 100, you can use sieve of Erastothenes.

You could also try google for your help. Please put in some effort to learn the language - a good ebook (also available in print) is Bruce Eckel's Thinking in C++.  

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Amit Kumar

Expertise

I can answer Cplusplus language and library questions, including STL, ACE, Boost. I have a good background in Mathematics.

Experience

Programming in CPP for about 8 years. Industry experience of 4 years.

Education/Credentials
Bachelors and Masters in Computer Science from Indian Institute of Technology Delhi.

©2016 About.com. All rights reserved.