Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Printing numbers having Odd divisors #412

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Beginner Level 📁/PrintPerfectSquares/PerfectSquare.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "bits/stdc++.h"
using namespace std;

int main(){
long long n;
cin>>n;
long long x = floor(sqrt(n));
for(long long i = 1;i<=x;i++){
cout<<(i*i)<<endl;
}
}
7 changes: 7 additions & 0 deletions Beginner Level 📁/PrintPerfectSquares/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Odd Divisors problem

Take input N
Range of 1<=N <=1e18
Print all numbers having odd divisors in the range [1,n]

#### Approach : Number which are perfect squares they have odd divisors (Complexity(O(sqrt(n))))
5 changes: 5 additions & 0 deletions Beginner Level 📁/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,10 @@
"githubUsername": "vimall03"
},

{
"name":"Jasleen Kaur",
"githubUsername": "7SepRash"
},

]