commit 252de6a8939ef6d2279a374319dc62fff4364e02
parent 46f342a4dcc286c2149df7bcb324a52f3676809d
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Sun, 2 Nov 2025 19:56:15 +0530
new practice code _pc001 to _pc005
Diffstat:
6 files changed, 378 insertions(+), 0 deletions(-)
diff --git a/docs/index.html b/docs/index.html
@@ -3857,6 +3857,241 @@ int main()
</li>
<li class="border rounded-lg overflow-hidden">
+ <div class="folder-header bg-gray-100 p-4 cursor-pointer hover:bg-blue-100 transition-colors duration-200" onclick="toggleFolder('practice-c')">
+ <div class="flex items-center justify-between">
+ <div class="flex items-center">
+ <svg class="w-6 h-6 text-blue-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path></svg>
+ <span class="font-medium text-gray-800">practice-c</span>
+ <span class="ml-2 text-sm text-gray-500">(5 files)</span>
+ </div>
+ <div class="flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/tree/main/practice-c" target="_blank" class="p-1 rounded-full text-gray-500 hover:bg-gray-200 hover:text-gray-800 transition-colors" onclick="event.stopPropagation()" title="View folder on GitHub">
+ <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.168 6.839 9.492.5.092.682-.217.682-.482 0-.237-.009-.868-.014-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.031-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.03 1.595 1.03 2.688 0 3.848-2.338 4.695-4.566 4.942.359.308.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.001 10.001 0 0022 12c0-5.523-4.477-10-10-10z" clip-rule="evenodd"></path></svg>
+ </a>
+ <div class="chevron" id="chevron-practice-c"><svg class="w-5 h-5 text-gray-500 transition-transform duration-200" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div>
+ </div>
+ </div>
+ </div>
+ <div class="folder-content hidden bg-white" id="folder-practice-c">
+ <ul class="divide-y divide-gray-200">
+
+ <li>
+ <div class="flex items-center p-3 pl-8 hover:bg-gray-50 transition-colors duration-200">
+ <svg class="w-6 h-6 text-green-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>
+ <span class="text-gray-700">pc001.c</span>
+ <div class="ml-auto flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc001.c" target="_blank" class="p-1 rounded-full text-gray-500 hover:bg-gray-200 hover:text-gray-800 transition-colors" title="View file on GitHub">
+ <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.168 6.839 9.492.5.092.682-.217.682-.482 0-.237-.009-.868-.014-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.031-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.03 1.595 1.03 2.688 0 3.848-2.338 4.695-4.566 4.942.359.308.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.001 10.001 0 0022 12c0-5.523-4.477-10-10-10z" clip-rule="evenodd"></path></svg>
+ </a>
+ <button onclick="showCode('code-practice-c-pc001_c', 'pc001.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button>
+ </div>
+ </div>
+ <div id="code-practice-c-pc001_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc001.c">
+ <pre><code class="language-c">/* Pattern :
+ 1
+ 1 2
+ 1 2 3
+ 1 2 3 4
+ 1 2 3 4 5
+for n = 5
+*/
+/* Author - Amit Dutta, Date - 02nd October, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int i, j, num;
+ printf("Enter n : ");
+ scanf("%d", &num);
+ for (i = 1; i <= num; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", j);
+ }
+ printf("\n");
+ }
+ return 0;
+}</code></pre>
+ </div>
+ </li>
+
+ <li>
+ <div class="flex items-center p-3 pl-8 hover:bg-gray-50 transition-colors duration-200">
+ <svg class="w-6 h-6 text-green-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>
+ <span class="text-gray-700">pc002.c</span>
+ <div class="ml-auto flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc002.c" target="_blank" class="p-1 rounded-full text-gray-500 hover:bg-gray-200 hover:text-gray-800 transition-colors" title="View file on GitHub">
+ <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.168 6.839 9.492.5.092.682-.217.682-.482 0-.237-.009-.868-.014-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.031-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.03 1.595 1.03 2.688 0 3.848-2.338 4.695-4.566 4.942.359.308.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.001 10.001 0 0022 12c0-5.523-4.477-10-10-10z" clip-rule="evenodd"></path></svg>
+ </a>
+ <button onclick="showCode('code-practice-c-pc002_c', 'pc002.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button>
+ </div>
+ </div>
+ <div id="code-practice-c-pc002_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc002.c">
+ <pre><code class="language-c">/* Pattern :
+ 1 2 3 4 5
+ 6 7 8 9
+ 10 11 12
+ 13 14
+ 15
+for n = 5
+*/
+
+/* Author - Amit Dutta, Date - 02nd NOVEMBER, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int i, j, n, temp = 1;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = n; i >= 1; i--)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", temp);
+ temp++;
+ }
+ printf("\n");
+ }
+ return 0;
+}</code></pre>
+ </div>
+ </li>
+
+ <li>
+ <div class="flex items-center p-3 pl-8 hover:bg-gray-50 transition-colors duration-200">
+ <svg class="w-6 h-6 text-green-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>
+ <span class="text-gray-700">pc003.c</span>
+ <div class="ml-auto flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc003.c" target="_blank" class="p-1 rounded-full text-gray-500 hover:bg-gray-200 hover:text-gray-800 transition-colors" title="View file on GitHub">
+ <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.168 6.839 9.492.5.092.682-.217.682-.482 0-.237-.009-.868-.014-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.031-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.03 1.595 1.03 2.688 0 3.848-2.338 4.695-4.566 4.942.359.308.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.001 10.001 0 0022 12c0-5.523-4.477-10-10-10z" clip-rule="evenodd"></path></svg>
+ </a>
+ <button onclick="showCode('code-practice-c-pc003_c', 'pc003.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button>
+ </div>
+ </div>
+ <div id="code-practice-c-pc003_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc003.c">
+ <pre><code class="language-c">/* Pattern :
+ 1
+ 2 4
+ 3 6 9
+ 4 8 12 16
+ 5 10 15 20 25
+for n = 5
+*/
+
+#include <stdio.h>
+int main()
+{
+ int i, j, n;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", i * j);
+ }
+ printf("\n");
+ }
+ return 0;
+}</code></pre>
+ </div>
+ </li>
+
+ <li>
+ <div class="flex items-center p-3 pl-8 hover:bg-gray-50 transition-colors duration-200">
+ <svg class="w-6 h-6 text-green-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>
+ <span class="text-gray-700">pc004.c</span>
+ <div class="ml-auto flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc004.c" target="_blank" class="p-1 rounded-full text-gray-500 hover:bg-gray-200 hover:text-gray-800 transition-colors" title="View file on GitHub">
+ <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.168 6.839 9.492.5.092.682-.217.682-.482 0-.237-.009-.868-.014-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.031-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.03 1.595 1.03 2.688 0 3.848-2.338 4.695-4.566 4.942.359.308.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.001 10.001 0 0022 12c0-5.523-4.477-10-10-10z" clip-rule="evenodd"></path></svg>
+ </a>
+ <button onclick="showCode('code-practice-c-pc004_c', 'pc004.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button>
+ </div>
+ </div>
+ <div id="code-practice-c-pc004_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc004.c">
+ <pre><code class="language-c">/* Pattern :
+ 5 4 3 2 1
+ 4 3 2 1
+ 3 2 1
+ 2 1
+ 1
+for n = 5
+*/
+
+#include <stdio.h>
+int main()
+{
+ int i, j, k, n;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = n; i >= 1; i--)
+ {
+ for (j = 1; j <= i - 1; j++)
+ {
+ printf("\t");
+ }
+ for (k = i; k >= 1; k--)
+ {
+ printf("%d\t", k);
+ }
+ printf("\n");
+ }
+ return 0;
+}</code></pre>
+ </div>
+ </li>
+
+ <li>
+ <div class="flex items-center p-3 pl-8 hover:bg-gray-50 transition-colors duration-200">
+ <svg class="w-6 h-6 text-green-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>
+ <span class="text-gray-700">pc005.c</span>
+ <div class="ml-auto flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc005.c" target="_blank" class="p-1 rounded-full text-gray-500 hover:bg-gray-200 hover:text-gray-800 transition-colors" title="View file on GitHub">
+ <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.168 6.839 9.492.5.092.682-.217.682-.482 0-.237-.009-.868-.014-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.031-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.03 1.595 1.03 2.688 0 3.848-2.338 4.695-4.566 4.942.359.308.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.001 10.001 0 0022 12c0-5.523-4.477-10-10-10z" clip-rule="evenodd"></path></svg>
+ </a>
+ <button onclick="showCode('code-practice-c-pc005_c', 'pc005.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button>
+ </div>
+ </div>
+ <div id="code-practice-c-pc005_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc005.c">
+ <pre><code class="language-c">/* Pattern :
+ 1
+ 1 2
+ 3 5 8
+ 13 21 34 55
+ 89 144 233 377 610
+for n = 5
+*/
+
+#include <stdio.h>
+int main()
+{
+ int i, j, n;
+ long long temp1 = 0, temp2 = 1, temp3;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ printf("1\n");
+ for (i = 2; i <= n; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ temp3 = temp1 + temp2;
+ printf("%lld\t", temp3);
+ temp1 = temp2;
+ temp2 = temp3;
+ }
+ printf("\n");
+ }
+ return 0;
+}</code></pre>
+ </div>
+ </li>
+ </ul>
+ </div>
+ </li>
+
+ <li class="border rounded-lg overflow-hidden">
<div class="folder-header bg-gray-100 p-4 cursor-pointer hover:bg-blue-100 transition-colors duration-200" onclick="toggleFolder('tuition-c')">
<div class="flex items-center justify-between">
<div class="flex items-center">
diff --git a/practice-c/pc001.c b/practice-c/pc001.c
@@ -0,0 +1,26 @@
+/* Pattern :
+ 1
+ 1 2
+ 1 2 3
+ 1 2 3 4
+ 1 2 3 4 5
+for n = 5
+*/
+/* Author - Amit Dutta, Date - 02nd October, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int i, j, num;
+ printf("Enter n : ");
+ scanf("%d", &num);
+ for (i = 1; i <= num; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", j);
+ }
+ printf("\n");
+ }
+ return 0;
+}+
\ No newline at end of file
diff --git a/practice-c/pc002.c b/practice-c/pc002.c
@@ -0,0 +1,28 @@
+/* Pattern :
+ 1 2 3 4 5
+ 6 7 8 9
+ 10 11 12
+ 13 14
+ 15
+for n = 5
+*/
+
+/* Author - Amit Dutta, Date - 02nd NOVEMBER, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int i, j, n, temp = 1;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = n; i >= 1; i--)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", temp);
+ temp++;
+ }
+ printf("\n");
+ }
+ return 0;
+}+
\ No newline at end of file
diff --git a/practice-c/pc003.c b/practice-c/pc003.c
@@ -0,0 +1,25 @@
+/* Pattern :
+ 1
+ 2 4
+ 3 6 9
+ 4 8 12 16
+ 5 10 15 20 25
+for n = 5
+*/
+
+#include <stdio.h>
+int main()
+{
+ int i, j, n;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", i * j);
+ }
+ printf("\n");
+ }
+ return 0;
+}+
\ No newline at end of file
diff --git a/practice-c/pc004.c b/practice-c/pc004.c
@@ -0,0 +1,29 @@
+/* Pattern :
+ 5 4 3 2 1
+ 4 3 2 1
+ 3 2 1
+ 2 1
+ 1
+for n = 5
+*/
+
+#include <stdio.h>
+int main()
+{
+ int i, j, k, n;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = n; i >= 1; i--)
+ {
+ for (j = 1; j <= i - 1; j++)
+ {
+ printf("\t");
+ }
+ for (k = i; k >= 1; k--)
+ {
+ printf("%d\t", k);
+ }
+ printf("\n");
+ }
+ return 0;
+}+
\ No newline at end of file
diff --git a/practice-c/pc005.c b/practice-c/pc005.c
@@ -0,0 +1,30 @@
+/* Pattern :
+ 1
+ 1 2
+ 3 5 8
+ 13 21 34 55
+ 89 144 233 377 610
+for n = 5
+*/
+
+#include <stdio.h>
+int main()
+{
+ int i, j, n;
+ long long temp1 = 0, temp2 = 1, temp3;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ printf("1\n");
+ for (i = 2; i <= n; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ temp3 = temp1 + temp2;
+ printf("%lld\t", temp3);
+ temp1 = temp2;
+ temp2 = temp3;
+ }
+ printf("\n");
+ }
+ return 0;
+}+
\ No newline at end of file