Repetition Structures

I need help in to make the following program can anyone help me. im new to c++
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>

using namespace std;

int main()
{
int Limit=21; 
/*
•	The Program just Check whether the Limit value entered by the user falls within the range from 10 to 150. (10 and 150 included in the given range.) 
•	Display those numbers which are divisible by both 3 and 5 in the range from 1 up to the Limit value e.g. if it's 21.
•	Calculate and display the sum of those numbers which are divisible by either 3 or 5.
•	Final task will be to count and display those numbers which are not divisible by 3 or 5.
*/

Thanks
Regards
Abhee
Last edited on
The Program just Check whether the Limit value entered by the user falls within the range from 10 to 150.


Do you know how to check if a number is less than 10?
i dont know
Why don't you write the parts you can do, then someone will be able to help with the parts you can't.

Can you read a value from the user and display that number?
have you seen the % operator?
This is effectively remainder from elementary school division,
that is 3%10 is 3/10 which is 0 with a remainder of 3.

a well known use of this operator (called mod, or modulus)
if you can divide a number evenly, it is zero. so 15%5 is 0, because 15 is divisible by 5.

With that alone, you can solve this program. The rest of the logic is just wrapping up what you have been taught to use this idea.
Topic archived. No new replies allowed.