Computer Science, asked by ranuagarwalm, 6 months ago

wap to input a number . count the number of odd factors and print it.​

Answers

Answered by gyaneshwarsingh882
0

Answer:

Explanation:

Program to find count of numbers having odd number of divisors in given range

Difficulty Level : Easy

Last Updated : 12 May, 2021

Given two integers A and B. The task is to count how many numbers in the interval [ A, B ] have an odd number of divisors.

Examples:  

Input : A = 1, B = 10

Output : 3

Input : A = 5, B = 15

Output : 1

Recommended:  

Please try your approach on {IDE} first, before moving on to the solution.

Naive Approach :

The simple approach would be to iterate through all the numbers between range [A, B] and check if their number of divisors is odd.

Below is the implementation of the above idea :

Similar questions