From 2867f7142e59d1d9d803f0d30386be7eab583f33 Mon Sep 17 00:00:00 2001 From: Pradeep Khatri Date: Sun, 2 Oct 2022 00:25:19 +0530 Subject: [PATCH 01/24] Implemented bubble sort --- C/BubbleSort.c | 40 ++++++++++++++++++++++++++++++++++++++++ CONTRIBUTORS.md | 1 + 2 files changed, 41 insertions(+) create mode 100644 C/BubbleSort.c diff --git a/C/BubbleSort.c b/C/BubbleSort.c new file mode 100644 index 00000000..09b8b3ee --- /dev/null +++ b/C/BubbleSort.c @@ -0,0 +1,40 @@ +// PradeepKhatri - https://github.com/PradeepKhatri + +#include + +void printArray(int *A,int n) +{ + for(int i=0;i A[j+1]) + { + temp = A[j]; + A[j] = A[j+1]; + A[j+1] = temp; + } + } + } +} + +int main() +{ + int A[] = {5,7,3,1,2}; + int n = 5; + printArray(A,n); + BubbleSort(A,n); + printArray(A,n); + +} + diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 711f7839..0c8384af 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,6 +29,7 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | +| Pradeep Khatri | Pradeep Khatri | E-Mail | From a5d6fc49931da4870f5270a9c9a85d8de6c3092d Mon Sep 17 00:00:00 2001 From: Pradeep Khatri Date: Sun, 2 Oct 2022 00:28:07 +0530 Subject: [PATCH 02/24] Updated contributions --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 0c8384af..043d7bf7 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,7 +29,7 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | -| Pradeep Khatri | Pradeep Khatri | E-Mail | +| Pradeep Khatri | Pradeep Khatri | E-Mail | From 0bf86134cbdbd486d5216359349dd7782c2adfff Mon Sep 17 00:00:00 2001 From: navdeepk037 <97962577+navdeepk037@users.noreply.github.com> Date: Sun, 2 Oct 2022 00:37:29 +0530 Subject: [PATCH 03/24] created factorial program in cpp --- C++/factorialprogram.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 C++/factorialprogram.cpp diff --git a/C++/factorialprogram.cpp b/C++/factorialprogram.cpp new file mode 100644 index 00000000..992da77a --- /dev/null +++ b/C++/factorialprogram.cpp @@ -0,0 +1,17 @@ +#include +using namespace std; +// github username navdeepk037 https://github.com/navdeepk037 +int fact(int n) +{ + int factorial=1; + for(int i=n;i>=1;i--) + factorial=factorial*i; + return factorial; +} +int main(){ + int n; + cout<<"enter the number "; + cin>>n; + cout<<"the factorial of the number is "< Date: Sun, 2 Oct 2022 08:35:57 +0530 Subject: [PATCH 04/24] Merge Sort cpp chiragchandnani10 --- C++/Merge_sort.cpp | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 C++/Merge_sort.cpp diff --git a/C++/Merge_sort.cpp b/C++/Merge_sort.cpp new file mode 100644 index 00000000..3d6eef25 --- /dev/null +++ b/C++/Merge_sort.cpp @@ -0,0 +1,61 @@ +/* +chiragchandnani10 +https://github.com/chiragchandnani10 +*/ + +#include +using namespace std; +void merging(int input[],int start,int end){ + int mid = (start+end)/2; + int i=start, j=mid+1, k=start; + int ans[end+1]; + while(i<=mid&&j<=end){ + if(input[i]=end){ + return; + } + int mid = ((start+end)/2); + merge_sort(input,start,mid); + merge_sort(input,mid+1,end); + merging(input,start,end); + + +} + + + +void mergeSort(int input[], int size){ + // Write your code here + + merge_sort(input,0,size-1); + + + +} + From ff747f8d48e9a262129c815f10813cfa11afd599 Mon Sep 17 00:00:00 2001 From: chiragchandnani10 <91424804+chiragchandnani10@users.noreply.github.com> Date: Sun, 2 Oct 2022 08:37:15 +0530 Subject: [PATCH 05/24] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 711f7839..44d658ec 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,6 +29,8 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | +| Chirag Chandnani | Chirag Chandnani | E-Mail | + From 56fbf1b3d9120a1082a06b38742f916c219a7a16 Mon Sep 17 00:00:00 2001 From: Aritroo Kumar Chowdhury <91552411+aritroo@users.noreply.github.com> Date: Sun, 2 Oct 2022 09:18:35 +0530 Subject: [PATCH 06/24] Added my name and email in contributors file --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 711f7839..ce9fc155 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,6 +29,7 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | +| Aritroo Chowdhury | Aritroo Chowdhury | E-Mail | From 88a3fb0582511f6b78863488fafabcf04dc69bbe Mon Sep 17 00:00:00 2001 From: Aritroo Kumar Chowdhury <91552411+aritroo@users.noreply.github.com> Date: Sun, 2 Oct 2022 09:23:42 +0530 Subject: [PATCH 07/24] Added Character pattern in Python --- character_pattern.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 character_pattern.py diff --git a/character_pattern.py b/character_pattern.py new file mode 100644 index 00000000..523a86ab --- /dev/null +++ b/character_pattern.py @@ -0,0 +1,32 @@ +# Python program to generate a character pattern + +# Github Username : aritroo + +#Example Output is given below :- +# Enter the number of rows : 5 +# A +# B B +# C C C +# D D D D +# E E E E E + + + +def character(n): + + num = 65 + + for i in range(0, n): + + for j in range(0, i+1): + + ch = chr(num) + + print(ch, end=" ") + + num = num + 1 + + print("\r") + +n = int(input("Enter the number of rows : ")) +character(n) From 3386274e80f8adcf028f924acd3b6f21a789af92 Mon Sep 17 00:00:00 2001 From: Aritroo Kumar Chowdhury <91552411+aritroo@users.noreply.github.com> Date: Sun, 2 Oct 2022 09:24:57 +0530 Subject: [PATCH 08/24] Delete character_pattern.py --- character_pattern.py | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 character_pattern.py diff --git a/character_pattern.py b/character_pattern.py deleted file mode 100644 index 523a86ab..00000000 --- a/character_pattern.py +++ /dev/null @@ -1,32 +0,0 @@ -# Python program to generate a character pattern - -# Github Username : aritroo - -#Example Output is given below :- -# Enter the number of rows : 5 -# A -# B B -# C C C -# D D D D -# E E E E E - - - -def character(n): - - num = 65 - - for i in range(0, n): - - for j in range(0, i+1): - - ch = chr(num) - - print(ch, end=" ") - - num = num + 1 - - print("\r") - -n = int(input("Enter the number of rows : ")) -character(n) From a4c26835339c35dd5b1736d23c37f8af3fefa87e Mon Sep 17 00:00:00 2001 From: KARTIKEY SINGH <91819372+kartik-ey1@users.noreply.github.com> Date: Sun, 2 Oct 2022 12:04:11 +0530 Subject: [PATCH 09/24] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 711f7839..00ee5780 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,6 +29,7 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | +| Kartikey Singh | Kartikey Singh | E-Mail | From e9fb6e570d387a2f57531f994fd5efe2402ba7ce Mon Sep 17 00:00:00 2001 From: Aritroo Kumar Chowdhury <91552411+aritroo@users.noreply.github.com> Date: Sun, 2 Oct 2022 13:23:15 +0530 Subject: [PATCH 10/24] Added Character Pattern in python --- Python/character_pattern.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Python/character_pattern.py diff --git a/Python/character_pattern.py b/Python/character_pattern.py new file mode 100644 index 00000000..523a86ab --- /dev/null +++ b/Python/character_pattern.py @@ -0,0 +1,32 @@ +# Python program to generate a character pattern + +# Github Username : aritroo + +#Example Output is given below :- +# Enter the number of rows : 5 +# A +# B B +# C C C +# D D D D +# E E E E E + + + +def character(n): + + num = 65 + + for i in range(0, n): + + for j in range(0, i+1): + + ch = chr(num) + + print(ch, end=" ") + + num = num + 1 + + print("\r") + +n = int(input("Enter the number of rows : ")) +character(n) From 62b594b827aff0e3d2d2f239bf5ec1a5d3a49360 Mon Sep 17 00:00:00 2001 From: vinaypathak07 <42654591+vinaypathak07@users.noreply.github.com> Date: Sun, 2 Oct 2022 13:32:38 +0530 Subject: [PATCH 11/24] Divisible Subarrays Using Pigeon Hole Principle --- ..._subarrays_using_pigeon_hole_principle.cpp | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 C++/divisible_subarrays_using_pigeon_hole_principle.cpp diff --git a/C++/divisible_subarrays_using_pigeon_hole_principle.cpp b/C++/divisible_subarrays_using_pigeon_hole_principle.cpp new file mode 100644 index 00000000..a2e46679 --- /dev/null +++ b/C++/divisible_subarrays_using_pigeon_hole_principle.cpp @@ -0,0 +1,53 @@ +// Github : vinaypathak07 +// Pigeonhole Principle +// Divisible SubArrays +#include +#include + +using namespace std; + +#define lol long + +lol a[1000005], frequency[1000005]; + +int main() { + + // #ifndef ONLINE_JUDGE + // freopen("input.txt", "r", stdin); + // freopen("output.txt", "w", stdout); + // #endif + + int t; + cin >> t; + + while (t--) { + int n; + cin >> n; + + memset(frequency, 0, sizeof(frequency)); + frequency[0] = 1; + + lol sum = 0; + + for (int i = 0; i < n; i++) { + cin >> a[i]; + + sum += a[i]; + sum %= n; + sum = (sum + n) % n; // sum+n because if we encountered negative value + frequency[sum] += 1; + } + + lol ans = 0; + + for (int i = 0; i < n; i++) { + if (frequency[i] > 1) { + lol m = frequency[i]; + ans += (m * (m - 1)) / 2; + } + } + cout << ans << endl; + } + + return 0; +} From 67484b1f300297de16a737354d8c85b68e02b2b1 Mon Sep 17 00:00:00 2001 From: Atinder Kumar <111070211+atinder11@users.noreply.github.com> Date: Sun, 2 Oct 2022 15:31:34 +0530 Subject: [PATCH 12/24] add the counting sort cpp add the counting sort cpp github: atinder11 --- C++/Counting_sort.cpp | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 C++/Counting_sort.cpp diff --git a/C++/Counting_sort.cpp b/C++/Counting_sort.cpp new file mode 100644 index 00000000..23d3b72c --- /dev/null +++ b/C++/Counting_sort.cpp @@ -0,0 +1,65 @@ +// C++ Program for counting sort +#include +#include +using namespace std; +#define RANGE 200 + +// The main function that sort +// the given string arr[] in +// alphabetical order +void countSort(char arr[]) +{ + // The output character array + // that will have sorted arr + char output[strlen(arr)]; + + // Create a count array to store count of individual + // characters and initialize count array as 0 + int count[RANGE + 1], i; + memset(count, 0, sizeof(count)); + + // Store count of each character + for (i = 0; arr[i]; ++i) + ++count[arr[i]]; + + // Change count[i] so that count[i] now contains actual + // position of this character in output array + for (i = 1; i <= RANGE; ++i) + count[i] += count[i - 1]; + + // Build the output character array + for (i = 0; arr[i]; ++i) { + output[count[arr[i]] - 1] = arr[i]; + --count[arr[i]]; + } + + /* + For Stable algorithm + for (i = sizeof(arr)-1; i>=0; --i) + { + output[count[arr[i]]-1] = arr[i]; + --count[arr[i]]; + } + + For Logic : See implementation + */ + + // Copy the output array to arr, so that arr now + // contains sorted characters + for (i = 0; arr[i]; ++i) + arr[i] = output[i]; +} + +// Driver code +int main() +{ + char arr[] = "countingsortincpp"; + + countSort(arr); + + cout << "Sorted character array is " << arr; + return 0; +} +//github : atinder11 + + From 6bd0b242a5e030a0d659fa247352def078c434d0 Mon Sep 17 00:00:00 2001 From: shobhitt8 <77393930+shobhitt8@users.noreply.github.com> Date: Sun, 2 Oct 2022 15:34:55 +0530 Subject: [PATCH 13/24] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 711f7839..d8a45004 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,6 +29,7 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | +| Shobhit Tiwari | Shobhit Tiwari | E-Mail | From cf3fac589ec096ebfd59bec22b9a909911b7bba9 Mon Sep 17 00:00:00 2001 From: Atinder Kumar <111070211+atinder11@users.noreply.github.com> Date: Sun, 2 Oct 2022 15:35:25 +0530 Subject: [PATCH 14/24] Update CONTRIBUTORS.md Add the details of Atinder Kumar --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 711f7839..f23afb7b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,6 +29,7 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | +| Atinder Kumar | Atinder Kumar | E-Mail | From 89ad7793208ccf878d796d491d7f0b4ecccb4348 Mon Sep 17 00:00:00 2001 From: Utkarsh-190 Date: Sun, 2 Oct 2022 15:47:43 +0530 Subject: [PATCH 15/24] added bucketSort algorithm --- C++/bucketSort.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 C++/bucketSort.cpp diff --git a/C++/bucketSort.cpp b/C++/bucketSort.cpp new file mode 100644 index 00000000..27105e33 --- /dev/null +++ b/C++/bucketSort.cpp @@ -0,0 +1,50 @@ +/* + Authors Name : Utkarsh Tyagi + Date Modified: 1 October, 2022 +*/ +// C++ program to sort an +// array using bucket sort +#include +#include +#include +using namespace std; + +// Function to sort arr[] of +// size n using bucket sort +void bucketSort(float arr[], int n) +{ + + // 1) Create n empty buckets + vector b[n]; + + // 2) Put array elements + // in different buckets + for (int i = 0; i < n; i++) { + int bi = n * arr[i]; // Index in bucket + b[bi].push_back(arr[i]); + } + + // 3) Sort individual buckets + for (int i = 0; i < n; i++) + sort(b[i].begin(), b[i].end()); + + // 4) Concatenate all buckets into arr[] + int index = 0; + for (int i = 0; i < n; i++) + for (int j = 0; j < b[i].size(); j++) + arr[index++] = b[i][j]; +} + +/* Driver program to test above function */ +int main() +{ + float arr[] + = { 0.897, 0.565, 0.656, 0.1234, 0.665, 0.3434 }; + int n = sizeof(arr) / sizeof(arr[0]); + bucketSort(arr, n); + + cout << "Sorted array is \n"; + for (int i = 0; i < n; i++) + cout << arr[i] << " "; + return 0; +} From dd3d0a1bc000e965ebf75a30f2be3c15d9317deb Mon Sep 17 00:00:00 2001 From: Aakash Jha <72294865+sky-jha@users.noreply.github.com> Date: Sun, 2 Oct 2022 16:04:52 +0530 Subject: [PATCH 16/24] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 711f7839..90c2fc1e 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,6 +29,7 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | +| Aakash Jha | Aakash Jha | E-Mail | From 69ef06258eeb6975e4886b898a945dde85484175 Mon Sep 17 00:00:00 2001 From: Garvit Verma <79037725+GarvitV957@users.noreply.github.com> Date: Sun, 2 Oct 2022 16:09:38 +0530 Subject: [PATCH 17/24] Created connected components cpp --- C++/Connected_components.cpp | 77 ++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 C++/Connected_components.cpp diff --git a/C++/Connected_components.cpp b/C++/Connected_components.cpp new file mode 100644 index 00000000..51dec77e --- /dev/null +++ b/C++/Connected_components.cpp @@ -0,0 +1,77 @@ +/* +░░░░░░░░░▄░░░░░░░░░░░░░░▄░░░░ +░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌░░░ +░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐░░░ +░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░ +░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐░░░ +░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌░░░ +░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌░░ +░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐░░ +░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌░ +░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌░ +▀▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐░ +▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌ +▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐░ +░▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌░ +░▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐░░ +░░▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌░░ +░░░░▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀░░░ +░░░░░░▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀░░░░░ +░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▀▀░░░░░░░░ +*/ + +// Github: GarvitV957 + +#include +using namespace std; +#define ll long long +#define lli long long int +#define vi vector +#define vvi vector +#define vll vector +#define vb vector +#define pb push_back +#define pii pair +#define all(x) x.begin(),x.end() + +int N=1e6 +1; +vvi adj(N); +vi vis(N,0); + +vvi cc; +vi current_comp; + +void dfs(int i){ + vis[i]=1; + current_comp.pb(i); + for(auto v:adj[i]){ + if(!vis[v]){ + dfs(v); + } + } +} + +int main(){ + ios_base::sync_with_stdio(false); + cin.tie(NULL); + + int n,e; + cin>>n>>e; + for(int i=0;i>x>>y; + adj[x].pb(y),adj[y].pb(x); + } + int c=0; + for(int i=1;i<=n;i++){ + if(!vis[i]){ + current_comp.clear(); + dfs(i); + cc.pb(current_comp); + c++; + } + } + cout< Date: Sun, 2 Oct 2022 17:48:03 +0530 Subject: [PATCH 18/24] Updated Contributors.MD --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 711f7839..9ddb4b98 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,6 +29,7 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | +| Vinay Pathak | Vinay Pathak | E-Mail | From 3d672113871a145d33d29121b46897763d853cb4 Mon Sep 17 00:00:00 2001 From: fikriks Date: Mon, 3 Oct 2022 06:16:00 +0700 Subject: [PATCH 19/24] add: comparing two fractions :rocket: --- C++/ComparingTwoFractions.cpp | 31 +++++++++++++++++++++++++++++++ CONTRIBUTORS.md | 14 +++----------- 2 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 C++/ComparingTwoFractions.cpp diff --git a/C++/ComparingTwoFractions.cpp b/C++/ComparingTwoFractions.cpp new file mode 100644 index 00000000..700442b1 --- /dev/null +++ b/C++/ComparingTwoFractions.cpp @@ -0,0 +1,31 @@ +// fikriks + +#include + +using namespace std; + +int main() +{ + int pecahan_pembilang1, pecahan_penyebut1, pecahan_pembilang2, pecahan_penyebut2; + float hasil1, hasil2; + + printf("%s\n", "Membandingkan Dua Bilangan Pecahan"); + printf("Masukan Bilangan Pecahan Ke-1 (Format Input = 1/2) = "); + scanf("%i/%i", &pecahan_pembilang1, &pecahan_penyebut1); + + printf("Masukan Bilangan Pecahan Ke-2 (Format Input = 1/2) = "); + scanf("%i/%i", &pecahan_pembilang2, &pecahan_penyebut2); + + hasil1 = (float) pecahan_pembilang1 / pecahan_penyebut1; + hasil2 = (float) pecahan_pembilang2 / pecahan_penyebut2; + + if(hasil1 == hasil2){ + printf("Pecahan Ke-1 (%i/%i) Sama Dengan Pecahan Ke-2 (%i/%i)", pecahan_pembilang1, pecahan_penyebut1, pecahan_pembilang2, pecahan_penyebut2); + }else if(hasil1 < hasil2){ + printf("Pecahan Ke-1 (%i/%i) Lebih Kecil Dari Pecahan Ke-2 (%i/%i)", pecahan_pembilang1, pecahan_penyebut1, pecahan_pembilang2, pecahan_penyebut2); + }else if(hasil1 > hasil2){ + printf("Pecahan Ke-1 (%i/%i) Lebih Besar Dari Pecahan Ke-2 (%i/%i)", pecahan_pembilang1, pecahan_penyebut1, pecahan_pembilang2, pecahan_penyebut2); + } + + return 0; +} diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 711f7839..f098c16b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -3,9 +3,10 @@ # Message

Enter your Name, Github Link & Your E-Mail Address in the given format. Don't try to change anything else!!!

-| Name | Github Link | E-Mail Address | +| Name | Github Link | E-Mail Address | # List of Contributors +

[*] Make sure you have updated your Name, Github link & E-Mail Id (enter your e-mail just after mailto:)!!!


@@ -29,16 +30,7 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | - - - - - - - - - - +| Daksh Kesarwani | Fikri Khairul Shaleh | E-Mail |

From 22c36db081f82714c92e64834729be65673137ca Mon Sep 17 00:00:00 2001 From: fikriks Date: Mon, 3 Oct 2022 12:43:23 +0700 Subject: [PATCH 20/24] update: contributor :rocket: --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f098c16b..713c3b0d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -30,7 +30,7 @@ | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | | Daksh Kesarwani | Daksh kesaarwani | E-Mail | -| Daksh Kesarwani | Fikri Khairul Shaleh | E-Mail | +| Fikri Khairul Shaleh | Fikri Khairul Shaleh | E-Mail |

From 67505a6d7b7258f6985387ed92bf335a31616e1f Mon Sep 17 00:00:00 2001 From: SanBuilds <68767061+SanBuilds@users.noreply.github.com> Date: Mon, 3 Oct 2022 13:15:51 +0530 Subject: [PATCH 21/24] Create hourglass_pattern.py Added a python file that demonstrates how to print an hourglass pattern using * --- Python/hourglass_pattern.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Python/hourglass_pattern.py diff --git a/Python/hourglass_pattern.py b/Python/hourglass_pattern.py new file mode 100644 index 00000000..bc293550 --- /dev/null +++ b/Python/hourglass_pattern.py @@ -0,0 +1,18 @@ +### Github Username - SanBuilds (https://github.com/SanBuilds) +### Hourglass pattern in python + +rows = int(input("Enter the rows(height) of the hourglass: ")) + +for i in range(rows): + for j in range(i): + print('', end = ' ') + for k in range(i,rows): + print('*', end = ' ') + print() + +for i in range(rows,-1,-1): + for j in range(i): + print('', end = ' ') + for k in range(i,rows): + print('*', end = ' ') + print() From ce89d909651816300abaa3138e551b71d1ce311c Mon Sep 17 00:00:00 2001 From: Sneha Baliyan <114647111+snehabaliyan@users.noreply.github.com> Date: Mon, 3 Oct 2022 14:25:54 +0530 Subject: [PATCH 22/24] Create CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 484a8240..32b28a66 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -37,6 +37,7 @@ | Tharindu Sooriyaarchchi | E-Mail | | Samriddh Prasad | Samriddh Prasad | E-Mail | | Edgar Gonzalez | Edgar Gonzalez | E-Mail | +| Sneha Chaudhary | Sneha Chaudhary | E-Mail | From b9db83a10531367cb229f4f6f95434f1e27a3376 Mon Sep 17 00:00:00 2001 From: Adarsh Addee <59617563+AdarshAddee@users.noreply.github.com> Date: Mon, 3 Oct 2022 20:58:15 +0530 Subject: [PATCH 23/24] Update README.md --- README.md | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 36aaab20..3fa1e539 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ✨Hacktoberfest 2022✨ +# ✨#Hacktoberfest 2022✨ A Simple😉 beginner friendly😊 Repo for all programmers and coders. All contributors are requested to star🌟this repo and and folllllow me. Contribute to start your journey with hacktoberfest and python. Happy Hacking💻!!! (*Required) @@ -6,40 +6,52 @@ Contribute to start your journey with hacktoberfest and python. Happy Hacking # 🌟Languages - 💻 C - 💻 C++ -- 💻 HTML - 💻 PHP - 💻 Python - 💻 Java - 💻 Javascript -- 💻 Dart + +# 🛡Rules to Contribute +- ⚓Star this repo to get latest updates. +- ⚓Give your file a proper extension according to language. Ex. .py, .java, .js. html etc. +- ⚓Name your file related to your topic. +- ⚓Put your files in correct folder like .py in Python, .js in Javascript etc. +- ⚓Make sure you have entered your github - username, aim and date in your file as a comment. +- ⚓Make sure you have entered your name in CONTRIBUTORS.md file as mentioned (It's your responsibility) (optional). +- ⚓You can follow ME😁. + +# ❄Format of 5th line in rules +
// Github username: Your Username
+// Aim: Your Repo aim according to your program
+// Date: Date of Coding
+
+// start coding
+
+
+ +### ⚡If your program have class try to use your class with its objects + +### ⚡If you are creating any PR then Add your name in CONTRIBUTORS.md file + +## 🛡Follow rules strictly for successful merged PR!!! # ❄Prgrams +- ⚡Create any pattern +- ⚡Make any algorithm (exclude calculator or related to it) - ⚡Print 1 to 100 without using numbers - ⚡Make calculator without using operators in program -- ⚡Create any pattern -- ⚡Make any algorithm -- ⚡Add webpage parts. - ⚡Calculate fibonacci series with classes - ⚡Calculate factorial with classes - ⚡Print IP Address and Hostname -- ⚡Any Game -## Don't forget to read the contributing rules mentioned below to be successfully merged your PR and get rewards!!! -## If you are using class, don't forget to implement it with it's objects +## Don't forget to read the contributing rules above to be successfully merged your PR and get rewards!!! 🏹 Visit Hacktoberfest to get more information about Hacktoberfest 2022!!! ✈ Visit Hacktoberfest-swag to know more about your swags and rewards!!! -# 🛡Rules to Contribute -- ⚓Star this repo to get latest updates. -- ⚓Give your file a proper extension according to language. Ex. .py, .java, .js. html etc. -- ⚓Name your file related to your topic. -- ⚓Put your files in correct folder like .py in Python, .js in Javascript etc. -- ⚓Make sure you have entered your github - username in your file as a comment. -- ⚓Make sure you have entered your name in CONTRIBUTORS.md file as mentioned (It's your responsibility). -- ⚓You can follow ME😁. +# 🛡 Strictly follow rules to contribute for successful merged PR!!! # Note All contributors who have followed the rules to contribute get successfully merged PR. Don't forget to follow!!! From dbdd3d57cc419f3cc22cb3b51d94ef7001747553 Mon Sep 17 00:00:00 2001 From: Adarsh Addee <59617563+AdarshAddee@users.noreply.github.com> Date: Tue, 4 Oct 2022 19:19:45 +0530 Subject: [PATCH 24/24] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 043d7bf7..2ec15049 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -28,8 +28,8 @@ | Aditya Wadkar | Aditya Wadkar | E-Mail | | Rahul Jangle | Ronny | E-Mail | | Anurag Vats | Anurag Vats | E-Mail | -| Daksh Kesarwani | Daksh kesaarwani | E-Mail | -| Pradeep Khatri | Pradeep Khatri | E-Mail | +| Daksh Kesarwani | Daksh kesaarwani | E-Mail | +| Pradeep Khatri | Pradeep Khatri | E-Mail |