Category: Number Theory
code: int euclid_gcd(int a,int b) { int dividend,divisor,remainder; dividend = a>=b?a:b; divisor= a<=b?a:b; while(divisor!=0) { remainder=dividend%divisor; dividend=divisor;…
code: #include<bits/stdc++.h> int main() { int i,n,ct=0;; scanf(“%d”,&n); for(i=2;i<=sqrt(n);i++) { if(n%i==0) { ct=0; while(n%i==0) { n=n/i; ct++;…
code: #include<bits/stdc++.h> int main() { int i,j,n,flag=0; printf(“enter number: “); scanf(“%d”,&n); for(i=2;i<=n;i++) //first iterate upto n {…
I have watched the videos from mycodeschool and implemented it: code: //find all prime numbers upto n…
Multiple of 3 is 3×1=3 3×2=6 3×3=9 3×4=12 3×5=15 3×6=18 3×7=21 3×8=24 3×9=27 3×10=30 Multiple of 4…
এখানে লজিকটা হচ্ছে…Here the logic is: For 12: 1×12=12 2×6=12 3×4=12 So factor of 12=1,2,3,4,6,12 (We don’t…
Recent Comments