diff --git a/C++/2021/9oct_ashutoshmittal26.cpp b/C++/2021/9oct_ashutoshmittal26.cpp new file mode 100644 index 000000000..d4c477fc7 --- /dev/null +++ b/C++/2021/9oct_ashutoshmittal26.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; + +int fact(int x) { + if (x < 2) + return 1; + int ans = 2; + for (int i = 3; i <= x; i++) + ans *= i; + return ans; +} + +int gcdOfFact(int a, int b) { + if(a +using namespace std; + +int factorial(int x) +{ + if (x <= 1) + return 1; + int res = 2; + for (int i = 3; i <= x; i++) + res = res * i; + return res; +} + +int gcdOfFactorial(int m, int n) +{ + return factorial(min(m, n)); +} + +int main() +{ + int m = 5, n = 9; + cout << gcdOfFactorial(m, n); + return 0; +} + diff --git a/C++/2021/9thOct_AnshuPathak-88825.cpp b/C++/2021/9thOct_AnshuPathak-88825.cpp new file mode 100644 index 000000000..955cd1ac4 --- /dev/null +++ b/C++/2021/9thOct_AnshuPathak-88825.cpp @@ -0,0 +1,45 @@ +#include +using namespace std; +int GCD(int num1, int num2) +{ + if (num1 == 0) + { + return num2; + } + + if (num2 == 0) + { + return num1; + } + + if (num1 == num2) + { + return num1; + } + + if (num1 > num2) + { + return GCD(num1 - num2, num2); + } + + return GCD(num1, num2 - num1); +} +int fact(int n) +{ + if (n == 0) + { + return 1; + } + return n * fact(n - 1); +} +int main() +{ + int a, b; + cin >> a >> b; + int numfact1 = fact(a); + int numfact2 = fact(b); + int GCDnum = GCD(numfact1, numfact2); + cout << GCDnum; + + return 0; +} \ No newline at end of file diff --git a/C++/2021/9thOct_Chandana-23.cpp b/C++/2021/9thOct_Chandana-23.cpp new file mode 100644 index 000000000..77bae07ff --- /dev/null +++ b/C++/2021/9thOct_Chandana-23.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; + + +int factorial(int x) +{ + if (x<=1) + { + return 1; + } + return x*factorial(x-1); + +} +int main() +{ + int a,b; + cin>>a>>b; + a = factorial(a); + b = factorial(b); + int result = a>b?a:b; + cout< + +using namespace std; + +long long int fact(int n){ + + if(n==0){ + return 1; + } + return n*fact(n-1); +} + +int main(){ + int a,b; + cin>>a>>b; + long long int ans=a>b? fact(b) : fact(a); + cout< +using namespace std; +int gcd(int a, int b) +{ + if (a == 0) + return b; + if (b == 0) + return a; + + if (a == b) + return a; + + if (a > b) + return gcd(a-b, b); + return gcd(a, b-a); +} +int main() +{ + int a = 98, b = 56; + cout<<"GCD of "< +using namespace std; + +int factorial(int num){ + int fact = 1, i; + for(i=1; i<=num; i++) + fact = fact * i; + return fact; +} +int gcd(int x, int y) { + if (y == 0){ + return x; + } + return gcd(y, x % y); +} +int main() { + int a,b; + cin>>a>>b; + int x=factorial(a); + int y=factorial(b); + cout< +#include +using namespace std; +int factorial(int x){ + if(x<0){ + return 0; + } + if(x==0){ + return 1; + } + + int fact=1; +for(int i=1;i<=x;i++){ + fact=fact*i; + +} +return fact; + +} +int gcdoffact(int m,int n){ + return (min(m,n)); + +} +int main(){ + +cout< +int factorial(int n) +{ + int f = 1; + int i; + for (i = 2; i <= n; i++) + f *= i; + return f; +} +int gcd(int a, int b) +{ if (a == 0) + return b; + if (b == 0) + return a; + if (a == b) + return a; + if (a > b) + return gcd(a-b, b); + return gcd(a, b-a); +} + +int main() +{ + int a = 5, b = 120; + printf("%d",factorial(gcd(a, b))); + return 0; +} diff --git a/C++/2021/9thOct_zeel88.cpp b/C++/2021/9thOct_zeel88.cpp new file mode 100644 index 000000000..f9c646678 --- /dev/null +++ b/C++/2021/9thOct_zeel88.cpp @@ -0,0 +1,25 @@ +#include +using namespace std; + +int find_factorial(int x) +{ + if (x <= 1) + return 1; + int res = 2; + for (int i = 3; i <= x; i++) + res = res * i; + return res; +} + +int gcd_Of_factorial(int m, int n) +{ + return find_factorial(min(m, n)); +} + +int main() +{ + int i,j; + cin>>i>>j; + cout << gcd_Of_factorial(i, j); + return 0; +} diff --git a/C++/2021/9thSep_Pooja-Das.cpp b/C++/2021/9thSep_Pooja-Das.cpp new file mode 100644 index 000000000..0aa3c7e7d --- /dev/null +++ b/C++/2021/9thSep_Pooja-Das.cpp @@ -0,0 +1,31 @@ +// Euclidean algo to find GCD of two numbers +#include +using namespace std; +// Recursive function to return gcd of a and b +int gcd(int a, int b) +{ + // Everything divides 0 + //Base case + if (a == 0) + return b; + if (b == 0) + return a; + + // base case + if (a == b) + return a; + + // a is greater + if (a > b) + return gcd(a-b, b); + return gcd(a, b-a); +} + +// Driver program to test above function +int main() +{ + int a,b; + cin>>a>>b; + cout<<"GCD of "< + + + + + + 10k Subscriber + + + + + + +
+ Why I started Twowaits? + #MyJourney + | Achintya Gaumat +
+
+
+ 5,584 views + + Apr 18,2021 +
+
+ + + 756 + + + + 13 + +
+
+
+
+
+ + Twowaits + 10k subscribers + +
+
+
+                In this I talk about what led me to start Twowaits and what all we do.
+
+                Connect on Linkedin :  https://www.linkedin.com/in/achintya-...
+                
+                Do read more about my work : https://medium.com/twowaits/our-dream...
+
+                SHOW LESS
+            
+ +
+
+ + \ No newline at end of file diff --git a/HTML CSS/intro_chandana-23.html b/HTML CSS/intro_chandana-23.html new file mode 100644 index 000000000..74e1de231 --- /dev/null +++ b/HTML CSS/intro_chandana-23.html @@ -0,0 +1,100 @@ + + + + + + + Twowaits + + + +
+ +
+
+

TATHASTU

+

To all your dreams for your career.

+

Pick a course relevant to your skillset and ambition.

+
CP, DSA, Python all courses you will ever need.
+
+
Those too at ridiculously low prices!
+
+
+ twowaits logo +
+
+
+
    +
  • 500+
    Students Empowered
  • +
  • 15+
    Unique Courses
  • +
  • 50+
    Colleges Impacted
  • +
+
+
+ + \ No newline at end of file diff --git a/JAVA/2021/9thOct_Farheen15320_.java b/JAVA/2021/9thOct_Farheen15320_.java new file mode 100644 index 000000000..74161b0be --- /dev/null +++ b/JAVA/2021/9thOct_Farheen15320_.java @@ -0,0 +1,26 @@ +import java.util.*; + + public class Main { + + public static void main(String[] args) { + Scanner scn = new Scanner(System.in); + int num1 = scn.nextInt(); + int num2 = scn.nextInt(); + + //storing original num + int tnum1 = num1; + int tnum2 = num2; + + while(tnum1 % tnum2 != 0){ + int rem = tnum1 % tnum2; + //changing divison & dividend + tnum1 = tnum2; + tnum2 = rem; + } + + int gcd = tnum2; + + System.out.println(gcd); + + } + } diff --git a/JAVA/2021/9thOct_Madanaa.java b/JAVA/2021/9thOct_Madanaa.java new file mode 100644 index 000000000..8e8872579 --- /dev/null +++ b/JAVA/2021/9thOct_Madanaa.java @@ -0,0 +1,28 @@ +import java.util.Scanner; +public class Main { + static int factorial(int x) +{ + if (x <= 1) + return 1; + int res = 2; + for (int i = 3; i <= x; i++) + res = res * i; + return res; +} + +static int gcdFactorial(int m, int n) +{ + int min = m < n ? m : n; + return factorial(min); +} + + + public static void main (String[] args) + { + + Scanner sc = new Scanner (System.in); + int m = sc.nextInt(); + int n = sc.nextInt(); + System.out.println(gcdFactorial(m, n)); + } +} diff --git a/JAVA/2021/9thOct_Paridhicodes.java b/JAVA/2021/9thOct_Paridhicodes.java new file mode 100644 index 000000000..a66a2b008 --- /dev/null +++ b/JAVA/2021/9thOct_Paridhicodes.java @@ -0,0 +1,16 @@ +//Solution to issue #1875 +//GCD of two factorials +import java.util.Scanner; +public class Solution{ + public static void main(String []args){ + Scanner sc= new Scanner(System.in); + int num1=sc.nextInt(); + int num2=sc.nextInt(); + int res=Math.min(num1,num2); + int fact=1; + for(int i=1;i<=res;i++){ + fact=fact*i; + } + System.out.println(fact);//Result is the factorial of the smallest number + } +} diff --git a/JAVA/2021/9thSep_Pooja-Das.java b/JAVA/2021/9thSep_Pooja-Das.java new file mode 100644 index 000000000..20fe57bc8 --- /dev/null +++ b/JAVA/2021/9thSep_Pooja-Das.java @@ -0,0 +1,29 @@ +import java.util.Scanner; +public class GCDExample3 { + + public static void main(String[] args) { + + int num1, num2; + + //Reading the input numbers + Scanner scanner = new Scanner(System.in); + System.out.print("Enter first number:"); + num1 = (int)scanner.nextInt(); + + System.out.print("Enter second number:"); + num2 = (int)scanner.nextInt(); + + //closing the scanner to avoid memory leaks + scanner.close(); + while (num1 != num2) { + if(num1 > num2) + num1 = num1 - num2; + else + num2 = num2 - num1; + } + + //displaying the result + System.out.printf("GCD of given numbers is: %d", num2); + } + +} diff --git a/JAVA/9thOct_Anupamtekale.java b/JAVA/9thOct_Anupamtekale.java new file mode 100644 index 000000000..fd55211e7 --- /dev/null +++ b/JAVA/9thOct_Anupamtekale.java @@ -0,0 +1,35 @@ +import java.util.*; + +class GCD +{ + public static int gcd(int x,int y) + { + if(y==0) + return x; + else + return gcd(y,x%y); + } + public static int factorial(int n) + { + if(n==1) + return 1; + else + return n*factorial(n-1); + } + + public static void main(String args[]) + { + Scanner in = new Scanner(System.in); + int arr[] = new int[2]; + for(int i=0;i int: + if num == 1: + return num + return num * factorial(num - 1) + +def gcd(num1: int, num2: int) -> int: + if num1 == num2: + return num1 + if num1 < num2: + smaller = num1 + larger = num2 + elif num1 > num2: + smaller = num2 + larger = num1 + for divisor in range(smaller, 0, -1): + if larger % divisor == 0: + return divisor + +def gcdOfFactorial(a: int, b:int) -> int: + return gcd(factorial(a), factorial(b)) + +a, b = [int(num) for num in input().split()] +print(gcdOfFactorial(a, b)) \ No newline at end of file diff --git a/Python/2021/9thOct_shagun0915.py b/Python/2021/9thOct_shagun0915.py new file mode 100644 index 000000000..cf79651b9 --- /dev/null +++ b/Python/2021/9thOct_shagun0915.py @@ -0,0 +1,20 @@ +#python program to find GCD of factorials of any two given numbers + +def factorial(num): + fact = 1 + i=1 + while i<=num: + fact = fact * i + i=i+1 + return fact + +def gcd(x,y): + if y == 0: + return x + return gcd(y, x % y) + +a = int(input()) +b = int(input()) +x=factorial(a) +y=factorial(b) +print(gcd(x,y)) diff --git a/Python/2021/9thOct_ujjwalhans.py b/Python/2021/9thOct_ujjwalhans.py new file mode 100644 index 000000000..af14028a3 --- /dev/null +++ b/Python/2021/9thOct_ujjwalhans.py @@ -0,0 +1,13 @@ +import math +def gcd(a,b): + if (b == 0): + return a + if (a == 0): + return b + if (a == b): + return a + if (a > b): + return gcd(a-b, b) + return gcd(a, b-a) +ans=gcd(5,10) +print(math.factorial(ans)) diff --git a/Python/2021/9thOct_zeel88.py b/Python/2021/9thOct_zeel88.py new file mode 100644 index 000000000..ab2ed7cfb --- /dev/null +++ b/Python/2021/9thOct_zeel88.py @@ -0,0 +1,9 @@ +import math + +def gcdOfFactorial(m, n) : + return math.factorial(min(m, n)) + +# Driver code +m = 5 +n = 9 +print(gcdOfFactorial(m, n)) diff --git a/Python/2021/9thOctharshita1017.py b/Python/2021/9thOctharshita1017.py new file mode 100644 index 000000000..e7241c5c7 --- /dev/null +++ b/Python/2021/9thOctharshita1017.py @@ -0,0 +1,13 @@ +# You are given two number a and b, you have to print the GCD of the factorials of these two numbers. +# Print the number on the basis of sample I/O provided below. + +import math + + +def gcdoffact(n1, n2): + return math.factorial(min(n1, n2)) + + +number1 = int(input("Enter first number :")) +number2 = int(input("Enter second number :")) +print(gcdoffact(number1, number2)) diff --git a/Python/2021/9thSep_Pooja-Das.py b/Python/2021/9thSep_Pooja-Das.py new file mode 100644 index 000000000..589c2d046 --- /dev/null +++ b/Python/2021/9thSep_Pooja-Das.py @@ -0,0 +1,9 @@ +def gcd(a,b): + if(b==0): + return a + else: + return gcd(b,a%b) +a=int(input("Enter first number:")) +b=int(input("Enter second number:")) +GCD=gcd(a,b) +print(GCD) diff --git a/Python/2021/9thoct_ssachis.py b/Python/2021/9thoct_ssachis.py new file mode 100644 index 000000000..ab2ed7cfb --- /dev/null +++ b/Python/2021/9thoct_ssachis.py @@ -0,0 +1,9 @@ +import math + +def gcdOfFactorial(m, n) : + return math.factorial(min(m, n)) + +# Driver code +m = 5 +n = 9 +print(gcdOfFactorial(m, n)) diff --git a/Python/9thoct_Srishti-1602.py b/Python/9thoct_Srishti-1602.py new file mode 100644 index 000000000..fda494ae7 --- /dev/null +++ b/Python/9thoct_Srishti-1602.py @@ -0,0 +1,10 @@ +import math + +def gcd(a, b): + return math.factorial(min(a, b)) + + +a= int(input("Enter first number: ")) +b= int(input("Enter second number: ")) + +print(gcd(a,b)) \ No newline at end of file