Skip to content

Commit

Permalink
Altered functions-in-cpp.md (#337)
Browse files Browse the repository at this point in the history
* Update index.js

* msg

* msg
  • Loading branch information
Amruta7203 authored Jun 17, 2024
1 parent f7a801c commit 6e3f024
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
10 changes: 6 additions & 4 deletions docs/day-02/comments-in-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ slug: comment-in-cpp



1. What is Comment in C++?
## 1. What is Comment in C++?
- A comment in C++ is a programmer-readable note that is inserted directly into the source code of a program.
- Comments are ignored by the compiler and are meant for the programmer’s use only.
- They serve as a form of in-code documentation, helping developers understand the purpose, logic, or explanation behind specific code lines
2. Why do we use comments in C++?

## 2. Why do we use comments in C++?
Comments serve several purposes:
- Explanation: They explain the code, making it more readable and understandable for other programmers.
- Debugging: Comments can be useful for debugging by providing context or temporarily disabling code segments.
Expand All @@ -21,7 +22,7 @@ Comments serve several purposes:

![comment-in-cpp](../../static/img/day-02/comment-in-cpp.png)

3. Write a simple program to demonstrate the use of comments in C++.
## 3. Write a simple program to demonstrate the use of comments in C++.
```cpp
#include <iostream>
using namespace std;
Expand All @@ -33,7 +34,8 @@ int main() {
}
```
In this program, we use both single-line comments (//) to explain the code and prevent execution of those comment lines
4. Types of comments in C++

## 4. Types of comments in C++
i. Single Line Comment
- Starts with // and applies to a single line only.
- Compiler ignores any text after //.
Expand Down
1 change: 1 addition & 0 deletions docs/day-07/function-in-cpp.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
sidebar_position: 3
title: "Function in C++"
description: "In this tutorial, we will learn about functions in C++ programming with the help of examples. A function is a block of code that performs a specific task. It is used to break the code into smaller modules that can be reused."
Expand Down
10 changes: 3 additions & 7 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ function HomepageHeader() {
<Heading as="h1" className={clsx("hero__title", styles.main_title)}>
{siteConfig.title}
</Heading>
main
<p className={clsx("hero__subtitle", styles.sub_title)}>{siteConfig.tagline}</p>

<p className={clsx("hero__subtitle", styles.sub_title)}>
{siteConfig.tagline}
</p>
main
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
Expand All @@ -51,12 +49,10 @@ export default function Home() {
description="30 days of CPP programming challenge is a step-by-step guide to learn CPP programming language in 30 days. Master the fundamental concepts of CPP Programming easily."
>
<HomepageHeader />
main
<main style={{ position: 'relative' }}>
<DailyTips />

</main>
<main style={{ position: "relative" }}>
main
<HomepageFeatures />
<Chatbot />
<div id="contact">
Expand All @@ -66,7 +62,7 @@ export default function Home() {
</Layout>
);
}
<script>

document.addEventListener('DOMContentLoaded', () => {
const snowflakesContainer = document.querySelector('.snowflakes');

Expand All @@ -88,4 +84,4 @@ export default function Home() {

setInterval(createSnowflake, 200);
});
</script>

0 comments on commit 6e3f024

Please sign in to comment.