commit e1fb0dd6e3a07b5212121219fcb790c7fc86d3b9 parent 079243001073bd091af7dea1efa75a65c079c8a2 Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 15:50:35 +0000 chore: update generated docs and changelog [skip ci] Diffstat:
| M | CHANGELOG.md | | | 10 | +++++----- |
| M | docs/changelog.md | | | 8 | ++++---- |
| M | docs/semester_2/practice/index.md | | | 11 | +++++++++++ |
| A | docs/semester_2/practice/prac_002.md | | | 77 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | docs/semester_2/practice/prac_003.md | | | 79 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | docs/semester_2/practice/prac_004.md | | | 78 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | docs/semester_2/practice/prac_005.md | | | 82 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | docs/semester_2/practice/prac_006.md | | | 80 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | docs/semester_2/practice/prac_007.md | | | 79 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | docs/semester_2/practice/prac_008.md | | | 77 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | docs/semester_2/practice/prac_009.md | | | 81 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | docs/semester_2/practice/prac_010.md | | | 79 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | docs/semester_2/practice/prac_011.md | | | 93 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | docs/semester_2/practice/prac_012.md | | | 79 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
14 files changed, 904 insertions(+), 9 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -1,16 +1,18 @@ # Changelog -> Last build: June 22, 2026 at 14:42 UTC +> Last build: June 22, 2026 at 15:49 UTC ## Latest Build -- **Build ID** — `cac55f2eeaaedefe0316130c3bb1bad24b231694` +- **Build ID** — `079243001073bd091af7dea1efa75a65c079c8a2` - **Triggered by** — [@notamitgamer](https://github.com/notamitgamer) - **Branch** — `main` -- **Build time** — June 22, 2026 at 14:42 UTC +- **Build time** — June 22, 2026 at 15:49 UTC ## Recent Commits +- [`0792430`](https://github.com/notamitgamer/bsc/commit/079243001073bd091af7dea1efa75a65c079c8a2) more practice — Amit Dutta, Jun 22, 2026 15:49 UTC +- [`06b1e3e`](https://github.com/notamitgamer/bsc/commit/06b1e3e11b7c6edaf64530633faa7bcfabdac5d1) chore: update generated docs and changelog [skip ci] — github-actions[bot], Jun 22, 2026 14:43 UTC - [`cac55f2`](https://github.com/notamitgamer/bsc/commit/cac55f2eeaaedefe0316130c3bb1bad24b231694) Merge pull request #9 from notamitgamer/copilot/fix-docs-deployment-issues — Amit Dutta, Jun 22, 2026 14:42 UTC - [`a5e1f0a`](https://github.com/notamitgamer/bsc/commit/a5e1f0a8dbbdc6e1c3bfab7bec00a23396a55aac) Refine workflow commit step guards and bot-trigger behavior — copilot-swe-agent[bot], Jun 22, 2026 14:40 UTC - [`a59636a`](https://github.com/notamitgamer/bsc/commit/a59636a4d23ea1698edb096dbcbde9ab45374dfe) Update workflow triggers and bot guards for generated docs deployments — copilot-swe-agent[bot], Jun 22, 2026 14:37 UTC @@ -29,8 +31,6 @@ - [`480b151`](https://github.com/notamitgamer/bsc/commit/480b151561ec51db42410a26d7a0674f763bea6c) chore: update CHANGELOG.md [skip ci] — github-actions[bot], Jun 21, 2026 11:58 UTC - [`44792f1`](https://github.com/notamitgamer/bsc/commit/44792f173aaa768df1387c962c0cd84ac9c50773) given full permission to ci — Amit Dutta, Jun 21, 2026 11:57 UTC - [`add7482`](https://github.com/notamitgamer/bsc/commit/add748214b8e325692066515e2f0e86c4519c15a) changelog — Amit Dutta, Jun 20, 2026 16:26 UTC -- [`4026f09`](https://github.com/notamitgamer/bsc/commit/4026f09203f51db5f5b408fd8191c3f1b67861f1) changelog — Amit Dutta, Jun 20, 2026 16:21 UTC -- [`93687f7`](https://github.com/notamitgamer/bsc/commit/93687f7194d6a015fa8f1feb361a0fa9a927b318) changelog — Amit Dutta, Jun 20, 2026 16:14 UTC --- diff --git a/docs/changelog.md b/docs/changelog.md @@ -9,13 +9,15 @@ description: 'Current build information and recent commit history.' Compare the Build ID (listed below) against the one in the [GitHub Changelog](https://github.com/notamitgamer/bsc/blob/main/CHANGELOG.md#latest-build) to verify that your browser is displaying the latest version. ::: -- **Build ID** — <span style="word-break: break-all;">`cac55f2eeaaedefe0316130c3bb1bad24b231694`</span> +- **Build ID** — <span style="word-break: break-all;">`079243001073bd091af7dea1efa75a65c079c8a2`</span> - **Triggered by** — [@notamitgamer](https://github.com/notamitgamer) - **Branch** — `main` -- **Build time** — June 22, 2026 at 14:42 UTC +- **Build time** — June 22, 2026 at 15:49 UTC ## Recent Commits +- [`0792430`](https://github.com/notamitgamer/bsc/commit/079243001073bd091af7dea1efa75a65c079c8a2) more practice — Amit Dutta, Jun 22, 2026 15:49 UTC +- [`06b1e3e`](https://github.com/notamitgamer/bsc/commit/06b1e3e11b7c6edaf64530633faa7bcfabdac5d1) chore: update generated docs and changelog [skip ci] — github-actions[bot], Jun 22, 2026 14:43 UTC - [`cac55f2`](https://github.com/notamitgamer/bsc/commit/cac55f2eeaaedefe0316130c3bb1bad24b231694) Merge pull request #9 from notamitgamer/copilot/fix-docs-deployment-issues — Amit Dutta, Jun 22, 2026 14:42 UTC - [`a5e1f0a`](https://github.com/notamitgamer/bsc/commit/a5e1f0a8dbbdc6e1c3bfab7bec00a23396a55aac) Refine workflow commit step guards and bot-trigger behavior — copilot-swe-agent[bot], Jun 22, 2026 14:40 UTC - [`a59636a`](https://github.com/notamitgamer/bsc/commit/a59636a4d23ea1698edb096dbcbde9ab45374dfe) Update workflow triggers and bot guards for generated docs deployments — copilot-swe-agent[bot], Jun 22, 2026 14:37 UTC @@ -34,5 +36,3 @@ Compare the Build ID (listed below) against the one in the [GitHub Changelog](ht - [`480b151`](https://github.com/notamitgamer/bsc/commit/480b151561ec51db42410a26d7a0674f763bea6c) chore: update CHANGELOG.md [skip ci] — github-actions[bot], Jun 21, 2026 11:58 UTC - [`44792f1`](https://github.com/notamitgamer/bsc/commit/44792f173aaa768df1387c962c0cd84ac9c50773) given full permission to ci — Amit Dutta, Jun 21, 2026 11:57 UTC - [`add7482`](https://github.com/notamitgamer/bsc/commit/add748214b8e325692066515e2f0e86c4519c15a) changelog — Amit Dutta, Jun 20, 2026 16:26 UTC -- [`4026f09`](https://github.com/notamitgamer/bsc/commit/4026f09203f51db5f5b408fd8191c3f1b67861f1) changelog — Amit Dutta, Jun 20, 2026 16:21 UTC -- [`93687f7`](https://github.com/notamitgamer/bsc/commit/93687f7194d6a015fa8f1feb361a0fa9a927b318) changelog — Amit Dutta, Jun 20, 2026 16:14 UTC diff --git a/docs/semester_2/practice/index.md b/docs/semester_2/practice/index.md @@ -7,4 +7,15 @@ Files and sub-folders in **Practice**. | # | File | Link | |---|---|---| | 1 | `prac_001.cpp` | [View Code](prac_001.md) | +| 2 | `prac_002.cpp` | [View Code](prac_002.md) | +| 3 | `prac_003.cpp` | [View Code](prac_003.md) | +| 4 | `prac_004.cpp` | [View Code](prac_004.md) | +| 5 | `prac_005.cpp` | [View Code](prac_005.md) | +| 6 | `prac_006.cpp` | [View Code](prac_006.md) | +| 7 | `prac_007.cpp` | [View Code](prac_007.md) | +| 8 | `prac_008.cpp` | [View Code](prac_008.md) | +| 9 | `prac_009.cpp` | [View Code](prac_009.md) | +| 10 | `prac_010.cpp` | [View Code](prac_010.md) | +| 11 | `prac_011.cpp` | [View Code](prac_011.md) | +| 12 | `prac_012.cpp` | [View Code](prac_012.md) | diff --git a/docs/semester_2/practice/prac_002.md b/docs/semester_2/practice/prac_002.md @@ -0,0 +1,77 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_002.cpp' +description: 'design a class circle.take radius as input, calculate the area' +source: 'semester_2/practice/prac_002.cpp' +--- + +# prac_002.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +design a class circle.take radius as input, calculate the area +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_002.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_002.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_002.cpp] +#include <iostream> +using namespace std; + +class circle { + int radius, area; + +public: + int input(); + int calculation(); + int output(); +}; + +int circle::input() { + cout << "\nEnter the radius of the circle : "; + cin >> radius; +} + +int circle::calculation() { + area = 3.14159 * radius * radius; +} + +int circle::output() { + cout << "\nThe area of the circle is : " << area; +} + +int main() { + circle z; + z.input(); + z.calculation(); + z.output(); + return 0; +} +``` diff --git a/docs/semester_2/practice/prac_003.md b/docs/semester_2/practice/prac_003.md @@ -0,0 +1,79 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_003.cpp' +description: 'Addition of two inputs' +source: 'semester_2/practice/prac_003.cpp' +--- + +# prac_003.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +Addition of two inputs +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_003.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_003.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_003.cpp] +#include <iostream> +using namespace std; + +class addoftwoinput { + int inp1, inp2, out; + +public: + void input(); + void calculation(); + void output(); +}; + +void addoftwoinput ::input() { + cout << "\nInsert the 1st number : "; + cin >> inp1; + cout << "\nInsert the 2nd number : "; + cin >> inp2; +} + +void addoftwoinput ::calculation() { + out = inp1 + inp2; +} + +void addoftwoinput ::output() { + cout << "\nSum of " << inp1 << " and " << inp2 << " is : " << out; +} + +int main() { + addoftwoinput z; + z.input(); + z.calculation(); + z.output(); + return 0; +} +``` diff --git a/docs/semester_2/practice/prac_004.md b/docs/semester_2/practice/prac_004.md @@ -0,0 +1,78 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_004.cpp' +description: 'check even or odd' +source: 'semester_2/practice/prac_004.cpp' +--- + +# prac_004.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +check even or odd +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_004.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_004.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_004.cpp] +#include <iostream> +using namespace std; +class ooe { + int n; + +public: + void input(); + void calcdisp(); +}; + +void ooe::input() { + cout << "Enter the number : "; + cin >> n; +} + +void ooe::calcdisp() { + if (n == 0) { + cout << "0 neither a odd or a even number."; + } + else if (n % 2 == 0) { + cout << n << " is a even number."; + } + else { + cout << n << " is a odd number."; + } +} + +int main() { + ooe a; + a.input(); + a.calcdisp(); + return 0; +} +``` diff --git a/docs/semester_2/practice/prac_005.md b/docs/semester_2/practice/prac_005.md @@ -0,0 +1,82 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_005.cpp' +description: 'check prime or not' +source: 'semester_2/practice/prac_005.cpp' +--- + +# prac_005.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +check prime or not +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_005.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_005.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_005.cpp] +#include <iostream> +using namespace std; + +class ponp { + int input, i; + +public: + void getinput(); + void calcdisp(); +}; + +void ponp::getinput() { + cout << "please enter the value : "; + cin >> input; +} + +void ponp::calcdisp() { + if (input <= 1) { + cout << "This is not a prime number."; + return; + } + + for (i = 2; i <= input / 2; i++) { + if (input % i == 0) { + cout << "this is not a prime number."; + return; + } + } + cout << "prime"; +} + +int main() { + ponp z; + z.getinput(); + z.calcdisp(); + return 0; +} +``` diff --git a/docs/semester_2/practice/prac_006.md b/docs/semester_2/practice/prac_006.md @@ -0,0 +1,80 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_006.cpp' +description: 'factorial' +source: 'semester_2/practice/prac_006.cpp' +--- + +# prac_006.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +factorial +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_006.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_006.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_006.cpp] +#include <iostream> +using namespace std; + +class fact { + int inp, a, i; + +public: + void input(); + void calc(); + void diplay(); +}; + +void fact::input() { + cout << "enter the number :"; + cin >> inp; + a = inp; +} + +void fact::calc() { + for (i = 1; i <= inp - 1; i++) { + a = a * i; + } +} + +void fact::diplay() { + cout << "Factorial " << a << "."; +} + +int main() { + fact z; + z.input(); + z.calc(); + z.diplay(); + return 0; +} +``` diff --git a/docs/semester_2/practice/prac_007.md b/docs/semester_2/practice/prac_007.md @@ -0,0 +1,79 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_007.cpp' +description: 'sum of natural numbers upto n' +source: 'semester_2/practice/prac_007.cpp' +--- + +# prac_007.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +sum of natural numbers upto n +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_007.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_007.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_007.cpp] +#include <iostream> +using namespace std; + +class add { + int inp, i, a = 0; + +public: + void input(); + void calc(); + void output(); +}; + +void add::input() { + cout << "enter the number : "; + cin >> inp; +} + +void add::calc() { + for (i = 1; i <= inp; i++) { + a = a + i; + } +} + +void add::output() { + cout << "Addtion = " << a; +} + +int main() { + add z; + z.input(); + z.calc(); + z.output(); + return 0; +} +``` diff --git a/docs/semester_2/practice/prac_008.md b/docs/semester_2/practice/prac_008.md @@ -0,0 +1,77 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_008.cpp' +description: 'number reverse' +source: 'semester_2/practice/prac_008.cpp' +--- + +# prac_008.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +number reverse +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_008.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_008.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_008.cpp] +#include <iostream> +using namespace std; + +class rev { + int inp, a = 0, b = 0; + +public: + void input(); + void calc(); +}; + +void rev::input() { + cout << "enter the number to reverse : "; + cin >> inp; + a = inp; +} + +void rev::calc() { + while (inp != 0) { + a = inp % 10; + b = b * 10 + a; + inp = inp / 10; + } + cout << b; +} + +int main() { + rev z; + z.input(); + z.calc(); + return 0; +} +``` diff --git a/docs/semester_2/practice/prac_009.md b/docs/semester_2/practice/prac_009.md @@ -0,0 +1,81 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_009.cpp' +description: 'sum of digits' +source: 'semester_2/practice/prac_009.cpp' +--- + +# prac_009.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +sum of digits +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_009.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_009.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_009.cpp] +#include <iostream> +using namespace std; + +class digitsum { + int inp, a = 0, b = 0; + +public: + void input(); + void calc(); + void output(); +}; + +void digitsum::input() { + cout << "enter the number :"; + cin >> inp; +} + +void digitsum::calc() { + while (inp > 0) { + a = inp % 10; + b = b + a; + inp = inp / 10; + } +} + +void digitsum::output() { + cout << "sum of the digits : " << b << "."; +} + +int main() { + digitsum z; + z.input(); + z.calc(); + z.output(); + return 0; +} +``` diff --git a/docs/semester_2/practice/prac_010.md b/docs/semester_2/practice/prac_010.md @@ -0,0 +1,79 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_010.cpp' +description: 'check odd or even' +source: 'semester_2/practice/prac_010.cpp' +--- + +# prac_010.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +check odd or even +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_010.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_010.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_010.cpp] +#include <iostream> +using namespace std; + +class ooe { + int n; + +public: + void input(); + void calcdisp(); +}; + +void ooe::input() { + cout << "Enter the number : "; + cin >> n; +} + +void ooe::calcdisp() { + if (n == 0) { + cout << "0 is neither an odd nor an even number."; + } + else if (n % 2 == 0) { + cout << n << " is a even number."; + } + else { + cout << n << " is a odd number."; + } +} + +int main() { + ooe a; + a.input(); + a.calcdisp(); + return 0; +} +``` diff --git a/docs/semester_2/practice/prac_011.md b/docs/semester_2/practice/prac_011.md @@ -0,0 +1,93 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_011.cpp' +description: 'average of elements' +source: 'semester_2/practice/prac_011.cpp' +--- + +# prac_011.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +average of elements +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_011.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_011.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_011.cpp] +#include <iostream> +using namespace std; + +class avarage { + int inp[100], sum = 0, n, i; + float avg; + +public: + void input(); + void calculation(); + void output(); +}; + +void avarage::input() { + cout << "\nEnter the number of elements : "; + cin >> n; + i = 0; + while (i < n) { + cout << "\nEnter the element no " << i + 1 << " : "; + cin >> inp[i]; + i++; + } +} + +void avarage::calculation() { + i = 0; + for (i = 0; i < n; i++) { + sum = sum + inp[i]; + } + avg = (float)sum / n; +} + +void avarage::output() { + i = 0; + cout << "\nAvarage of the element "; + for (i = 0; i < n; i++) { + cout << " " << inp[i]; + } + cout << " is : " << avg; +} + +int main() { + avarage z; + z.input(); + z.calculation(); + z.output(); + return 0; +} +``` diff --git a/docs/semester_2/practice/prac_012.md b/docs/semester_2/practice/prac_012.md @@ -0,0 +1,79 @@ +--- +title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg> prac_012.cpp' +description: 'factorial using loop' +source: 'semester_2/practice/prac_012.cpp' +--- + +# prac_012.cpp + +### Metadata + +- **Author** — Amit Dutta (amitdutta4255@gmail.com) +- **Last updated** — 22 Jun 2026 +- **License** — [MIT](https://github.com/notamitgamer/bsc/blob/main/LICENSE) + + +### Problem Statement + +::: tip Problem Statement +factorial using loop +::: + +## Source Code + +<div style="display:flex;gap:12px;margin-bottom:12px;"> + <a href="https://github.com/notamitgamer/bsc/blob/main/semester_2/practice/prac_012.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-brand);"> + <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;"> + <path d="M12 0C5.37 0 0 5.373 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.258 .82-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.757 -1.333-1.757-1.089-.745.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3 -5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523 .105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873 .12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92 .42.36.81 1.096.81 2.22v3.293c0 .319.21.694.825.576C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z"/> + </svg> + View on GitHub + </a> + <a href="https://raw.usercontent.amit.is-a.dev/semester_2/practice/prac_012.cpp" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:6px;font-size:0.85rem; text-decoration:none;color:var(--vp-c-text-2);"> + <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;"> + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> + <polyline points="7 10 12 15 17 10"/> + <line x1="12" y1="15" x2="12" y2="3"/> + </svg> + Download Raw + </a> +</div> + +::: info Printing the code +To print this file, open it on GitHub and click **Raw** before printing, or use the **Download Raw** button above and print directly from that page. +::: +```cpp [prac_012.cpp] +#include <iostream> +using namespace std; + +class fact { + int inp, a = 1, i; + +public: + void input(); + void calc(); + void output(); +}; + +void fact::input() { + cout << "enter the number :"; + cin >> inp; +} + +void fact::calc() { + for (i = 1; i <= inp; i++) { + a = a * i; + } +} + +void fact::output() { + cout << "factorial : " << a; +} + +int main() { + fact z; + z.input(); + z.calc(); + z.output(); + return 0; +} +```