- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

- Take in the upper and lower range and store them in separate variables.
- Use a for loop which ranges from the lower range to the upper range.
- Find the numbers which are divisible by both 5 and 7.
- Print those numbers.

Case 1Enter the lower range: 1 Enter the upper range: 100 35 70 | Case 2Enter the lower range: 400 Enter the upper range: 700 420 455 490 525 560 595 630 665 700 |

- User must enter the upper range limit and the lower range limit.
- The for loop ranges from the lower limit to the upper limit.
- The value of i ranges from the lower limit to the upper limit.
- Whenever the remainder of i divided by 5 and 7 is equal to 0, print i.

package main import "fmt" func main(){ var upperLimit, lowerLimit int fmt.Printf("Enter lower limit for the range: ") fmt.Scanf("%d", &lowerLimit) fmt.Printf("Enter upper limit for the range: ") fmt.Scanf("%d", &upperLimit) for i:=lowerLimit; i<=upperLimit; i++{ if i%7 == 0 && i%5 == 0{ fmt.Println(i) } } }

Enter lower limit for the range: 1 Enter upper limit for the range: 100 35 70

- Related Questions & Answers
- Golang Program to Print all Numbers in a Range Divisible by a Given Number
- Sum of first N natural numbers which are divisible by 2 and 7 in C++
- Write a Golang program to find prime numbers in a given range
- C# program to print all the numbers divisible by 3 and 5 for a given number
- Python program to print all the numbers divisible by 3 and 5 for a given number
- Python Program to Print all Numbers in a Range Divisible by a Given Number
- Python Program to Find All Numbers which are Odd and Palindromes Between a Range of Numbers
- Program to print all the numbers divisible by 3 and 5 in C++
- Golang Program to Print Odd Numbers Within a Given Range
- Count numbers in range 1 to N which are divisible by X but not by Y in C++
- Write a Golang program to find duplicate elements in a given range
- Count the numbers divisible by ‘M’ in a given range in C++
- Count numbers which are divisible by all the numbers from 2 to 10 in C++
- Program to find nth term of a sequence which are divisible by a, b, c in Python
- PHP program to find the sum of odd numbers within a given range

Advertisements