Skip to content

Commit

Permalink
add multiple new file
Browse files Browse the repository at this point in the history
  • Loading branch information
Code-With-Abhishek-Kumar committed Aug 16, 2024
1 parent d143cde commit 561a122
Show file tree
Hide file tree
Showing 3,670 changed files with 492,653 additions and 9 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
91 changes: 84 additions & 7 deletions C/01_Day_Introduction_to_C_Programming/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,95 @@ C ek general-purpose programming language hai jo 1970s ke early years mein Denni
## History of C

- **BCPL (Basic Combined Programming Language)**:
- **Vikas**:


- BCPL ko Martin Richards ne 1966 mein develop kiya tha. Yeh ek simple aur flexible programming language thi jo system programming ke liye design ki gayi thi. Iska primary goal tha system-level programming aur compiler writing ko asaan banana. BCPL ne programming ko simplify kiya aur system software development ke liye ek foundational language provide ki, jisse zyada efficient aur manageable code likha ja sake.


- Developed by Martin Richards in 1966, it was designed to simplify system-level programming.

- BCPL ko Martin Richards ne 1966 mein develop kiya tha. Yeh ek simple aur flexible programming language thi jo system programming ke liye design ki gayi thi. Iska primary goal tha system-level programming aur compiler writing ko asaan banana.






- BCPL ne programming ko simplify kiya aur system software development ke liye ek foundational language provide ki, jisse zyada efficient aur manageable code likha ja sake.


- Developed by Martin Richards in 1966, it was designed to simplify system-level programming.


`=> **Limitation and why we need B**:`

- BCPL (Basic Combined programming Language ) mein limitation thi , jiski wajah se B language ka development hua.


1. Single Data Type

- BCPL used one data type for all values , making it inefficient and error - prone.


- BCPL Sirf ek hi data Type support karta tha jo usually ek integer ya pointer hota tha.

- Isse alag alag types of data ko handle karna mushkil hota tha.

- Example k liye , integers ya pointer hota tha aur character's ko differentiate karna tough hota tha jis se bugs aur errors hone ke chances badh jate the.


2. No structures or Records


- BCPL ko no structure or records hai, jiski wajah se C language ka development hua.


- BCPL lacked support for structure making Complex data organization difficult.


- Structures aur Records Composite data types hote hain jo multiple variables ko ek naam ke under group karte hain, jaise student record(name , age , grade).


- BCPL mein inka support nahi tha , to related data items ko separately manage karna padta tha.

- Isse Code Complex aur error - prone ho jata tha kyuki sub data alag - alag variable mein rakhna tha.


3. Poor Portability
































- **B Language**:
- **Vikas**:


- Ken Thompson aur Dennis Ritchie ne late 1960s mein B language develop ki. Ken Thompson ko programming languages mein simplicity aur efficiency bahut pasand thi. B language ko design karte waqt, unhone BCPL ki simplicity aur flexibility ko dhyan mein rakha. B ko bhi system programming ke liye design kiya gaya tha, lekin isme BCPL ki complexity ko streamline kiya gaya. Yahan "streamline" ka matlab hai ki B language ne BCPL ke features ko simplify aur optimize kiya, jisse code likhna aur manage karna aur bhi aasan ho gaya. B ka design minimal tha, matlab isme sirf woh features the jo essential the, jisse code likhna aur manage karna aasan ho jaye. Yeh design early computers ke limited resources ke liye ideal tha, kyunki yeh lightweight aur efficient tha.
- Ken Thompson aur Dennis Ritchie ne late 1960s mein B language develop ki. Ken Thompson ko programming languages mein simplicity aur efficiency bahut pasand thi. B language ko design karte waqt, unhone BCPL ki simplicity aur flexibility ko dhyan mein rakha. B ko bhi system programming ke liye design kiya gaya tha, lekin isme BCPL ki complexity ko streamline kiya gaya.

- Yahan "streamline" ka matlab hai ki B language ne BCPL ke features ko simplify aur optimize kiya, jisse code likhna aur manage karna aur bhi aasan ho gaya. B ka design minimal tha, matlab isme sirf woh features the jo essential the, jisse code likhna aur manage karna aasan ho jaye. Yeh design early computers ke limited resources ke liye ideal tha, kyunki yeh lightweight aur efficient tha.


- Developed by Ken Thompson and Dennis Ritchie in the late 1960s, B was a simplified version of BCPL, aimed at system programming but with fewer features.
Expand Down
Binary file modified C/02_Day_Syntax/02_StarterCode/02_Syntax
Binary file not shown.
133 changes: 133 additions & 0 deletions C/02_Day_Syntax/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@



# C Basic Syntax


````c
#include <stdio.h> // Include standard input/output library

int main() {

printf("Hello World"); // Print the result to the console
return 0; // End of the program
}

````


## 1. Include Statement: #include <stdio.h>

`````c
#include <stdio.h>
`````

**`Purpose`**

- This line tells the computer to use a set of pre-written code from the `stdio.h` library.

- Ye line compiler ko batata hai ki `stdio.h` file ko include karna hai.


- `stdio.h` library input/output ke liye zaroori functions provide kr ta hain, jaise printf jo screen par text print karta hai.


**Why It’s Needed:**

- `stdio.h` library contains functions for doing input and output, like printing text on the screen.


## 2. Main Function: `int main()`


````c
int main() {
// code goes here
}

````

- The main function is the starting point of execution in a C program. Every C program must have a main function.

- The `int` before `main` indicates that this function returns an integer value to the operating system upon completion.


- The code between `{ and }` is the body of the main function, where the actual execution happens.

- Ye main function hai jahan se program run hota hai

- `int` ka matlab hai ki ye function ek integer value return karega, jo operating system ko batata hai ki program sahi se chala ya nahi.


## 3. Curly Braces: `{ and }`

````c
{
// code
}
````

- Curly braces mark the start and end of the main function’s code. Everything between them is the part of the program that gets executed.

- Ye curly braces batate hain ki main function ka code kahan se shuru hota hai aur kahan khatam hota hai.

- In braces ke beech ka code execute hota hai jab program run hota hai.

## 4. `printf("Hello World");`

````c
printf("Hello World");
````
- This line shows the text “Hello World” on the screen.
- Ye line "Hello World" text ko screen par print karti hai.
- `printf` is a function from the stdio.h library that handles displaying text.
- `printf` ek function hai jo stdio.h file se aata hai aur text ko screen par dikhata hai.
## 5. `return 0;`
````c
return 0;
````


- The return statement ends the main function and returns a value to the operating system.

- `0` is a common value used to indicate that the program executed successfully.


- Ye line main function ko khatam karti hai aur 0 return karti hai.

- `0 Ka Matlab`: 0 batata hai ki program successfully complete hua hai.


## Full Program in Hinglish


````c
#include <stdio.h> // Standard input/output library ko include karo

int main() { // Program ka main function jahan se execution shuru hota hai
printf("Hello World"); // Screen par "Hello World" print karo
return 0; // Program ko successfully end karo aur 0 return karo
}

````


- Kya Hota Hai:

1. `#include <stdio.h>` se zaroori functions include ho jaate hain.

2. Program main function se shuru hota hai.
printf function "Hello World" ko screen par dikhata hai.

3. Program 0 return karke khatam hota hai, jo successful execution ko batata hai.

Yeh basic C program hai jo aapko programming ki basic syntax samajhne mein madad karta hai.
Loading

0 comments on commit 561a122

Please sign in to comment.