diff --git a/.all-contributorsrc b/.all-contributorsrc
new file mode 100644
index 0000000..92d5bc2
--- /dev/null
+++ b/.all-contributorsrc
@@ -0,0 +1,4 @@
+{
+ "projectName": "Vitamin-C-Programming-book",
+ "projectOwner": "KaziRifatMorshed"
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index 554a74e..49d1a2b 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# Vitamin-C-Programming-book
-Supplement like C Programming guide book for beginners
- Link: [https://kazirifatmorshed.github.io/Vitamin-C-Programming-book/](https://kazirifatmorshed.github.io/Vitamin-C-Programming-book/)
+Supplement like C Programming guide book for beginners\
+Link:
# How to contribute
@@ -15,13 +15,13 @@ Vitamin-C-Programming-book/
└── SUMMARY.md
```
-- The `src` directory is where you write your book in markdown. It contains all
+* The `src` directory is where you write your book in markdown. It contains all
the source files, configuration files, etc.
-- The `book` directory is where your book (html) is rendered. All the output is ready
+* The `book` directory is where your book (html) is rendered. All the output is ready
to be uploaded to a server to be seen by your audience.
-- The `SUMMARY.md` is the skeleton of your
+* The `SUMMARY.md` is the skeleton of your
book, and is discussed in more detail [in another
chapter](../format/summary.md).
@@ -55,7 +55,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
### Structure
-1. **_Title_** - While optional, it's common practice to begin with a title, generally # Summary
. This is ignored by the parser however, and
can be omitted.
@@ -63,7 +63,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
# Summary
```
-1. **_Prefix Chapter_** - Before the main numbered chapters, prefix chapters can be added
+2. ***Prefix Chapter*** - Before the main numbered chapters, prefix chapters can be added
that will not be numbered. This is useful for forewords,
introductions, etc. There are, however, some constraints. Prefix chapters cannot be
nested; they should all be on the root level. And you cannot add
@@ -75,7 +75,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
- [First Chapter](relative/path/to/markdown2.md)
```
-1. **_Part Title_** -
+3. ***Part Title*** -
Level 1 headers can be used as a title for the following numbered chapters.
This can be used to logically separate different sections of the book.
The title is rendered as unclickable text.
@@ -88,7 +88,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
- [First Chapter](relative/path/to/markdown.md)
```
-1. **_Numbered Chapter_** - Numbered chapters outline the main content of the book
+4. ***Numbered Chapter*** - Numbered chapters outline the main content of the book
and can be nested, resulting in a nice hierarchy
(chapters, sub-chapters, etc.).
@@ -106,7 +106,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
Numbered chapters can be denoted with either `-` or `*` (do not mix delimiters).
-1. **_Suffix Chapter_** - Like prefix chapters, suffix chapters are unnumbered, but they come after
+5. ***Suffix Chapter*** - Like prefix chapters, suffix chapters are unnumbered, but they come after
numbered chapters.
```markdown
@@ -115,7 +115,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
[Title of Suffix Chapter](relative/path/to/markdown2.md)
```
-1. **_Draft chapters_** - Draft chapters are chapters without a file and thus content.
+6. ***Draft chapters*** - Draft chapters are chapters without a file and thus content.
The purpose of a draft chapter is to signal future chapters still to be written.
Or when still laying out the structure of the book to avoid creating the files
while you are still changing the structure of the book a lot.
@@ -127,7 +127,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
- [Draft Chapter]()
```
-1. **_Separators_** - Separators can be added before, in between, and after any other element. They result
+7. ***Separators*** - Separators can be added before, in between, and after any other element. They result
in an HTML rendered line in the built table of contents. A separator is
a line containing exclusively dashes and at least three of them: `---`.
@@ -141,7 +141,25 @@ is very strict and must follow the structure outlined below to allow for easy pa
- [First Chapter](relative/path/to/markdown2.md)
```
----
+***
-[Kazi Rifat Morshed](https://kazirifatmorshed.github.io)
+## Contributors
+
+
+
+
+
+
+
+
+
+
+
+
+
+[![All Contributors](https://img.shields.io/github/all-contributors/KaziRifatMorshed/Vitamin-C-Programming-book?color=ee8449\&style=flat-square)](#contributors)
+
+***
+
+[Kazi Rifat Morshed](https://kazirifatmorshed.github.io)\
KU CSE 230220
diff --git a/src/FileOperations/FileOperations.md b/src/FileOperations/FileOperations.md
index 97d0294..258eff1 100644
--- a/src/FileOperations/FileOperations.md
+++ b/src/FileOperations/FileOperations.md
@@ -1 +1,29 @@
# File Operations
+
+# Notes on File Operation with C
+
+| Function |Description |
+|-|-|
+| `fopen()` |opens new or existing file |
+| `fprintf()`| write data into the file \["ফাইল" স্ট্রিম, কি স্ট্রিং ফরম্যাটে সেইভ করব, স্ট্রিম সোর্স] |
+| `fscanf()`| reads data from the file ` while(fscanf(fp,"%d",&temp_num)!=EOF){` |
+| `fputc()` |writes a character into the file |
+| `fgetc()` |reads a character (in loop, character by character) from file `while ((c = fgetc(fp)) != EOF) {printf("%c", c);` |
+| `fputs()` |put(WRITE) a whole string to the file |
+| `fgets()` |using while(fgets!=NULL), reads "line by line" from file with whitespace and sets to buffer string ` while (fgets(str, 300, f) != NULL) {printf("%s", str);`; `while (fgets(line, sizeof(str_line), f)) {` |
+| `fclose()`| closes the file |
+| `fseek()` |sets the file pointer to given position |
+| `fputw()` |writes an integer to file |
+| `fgetw()` |reads an integer from file |
+| `ftell()` |returns current position |
+| `rewind()`| sets the file pointer to the beginning of the file |
+
+## notes and tricks
+
+* `scanf("%[^EOF]",str);` read full file at once
+* `freopen("fileout.txt", "w", stdout);` directly save into the file (steam bypass)
+* `fprintf()` e W+ dile full file override hoy, r+ thakle shudhu oi position er char gulo
+* `fscanf()`: format `%c` ar `%s` er upor depend kore kivabe source theke ek ek kore collect korbe. jodi `%s` use kori then: ek ekta word by word catch kore, so, \_buff (steam) e ekta ekta kore word dhukse, without counting whitespace characters, so, while loop er vitore amake `printf()` er vitore ekta space ditei hosse Jemon silo temon paite hole `fscanf` er vitore `C` ar `printf` er vitore `S`.
+* `int temp = 0; while (fscanf(f_input, "%d", &temp) != EOF) {`
+* `while (fscanf(ptr, "%c", &str[i]) != EOF && i < 199) { i++;}`
+* ` while((ptr=strstr(str,word))!=NULL) {memmove(ptr,ptr+len,strlen(ptr+len)+1);}`
diff --git a/src/FileOperations/FileOperationsPracticeProblems.md b/src/FileOperations/FileOperationsPracticeProblems.md
new file mode 100644
index 0000000..7a654c6
--- /dev/null
+++ b/src/FileOperations/FileOperationsPracticeProblems.md
@@ -0,0 +1,363 @@
+# Practice Problems
+
+These problems are directly taken from . **For solutions, please visit this github repo. You will find solutions in respective folder.**
+
+@main\_author : Durjay1729\
+Github:
+
+## 1. Write a C program to read numbers from a file and write even, odd and prime numbers to three separate file.
+
+input->
+
+```
+73771782 81296771 79982326 75332246 10128193
+81643413 76259734 94432076 50063976 91748657
+42311916 -1920042 90747362 53851612 43498487
+73193311 96685173 39019033 8630045 59322952
+```
+
+Output->
+
+even.txt
+
+```
+73771782
+79982326
+75332246
+76259734
+94432076
+50063976
+42311916
+-1920042
+90747362
+53851612
+59322952
+59322952
+```
+
+odd.txt
+
+```
+81296771
+81643413
+91748657
+43498487
+96685173
+8630045
+```
+
+prime.txt
+
+```
+10128193
+73193311
+39019033
+```
+
+***
+
+## 2. Write a C program to compare two files.
+
+input ->
+File1.txt
+
+```
+Learn C programming at KU.
+Working with files and directories.
+```
+
+File2.txt ->
+
+```
+Learn C programming at KU.
+Working with chatgpt and copilot.
+```
+
+Output->
+
+```
+Files are not equal.
+Line: 2, column: 14
+```
+
+***
+
+## 3. Write a C program to copy contents from one file to another file.
+
+Hint with Solution:
+
+```c
+~#include
+~#include
+~
+~int main(void) {
+~
+~ FILE *f1 = fopen("file3_1.txt", "r"), *f2 = fopen("file3_2.txt", "w");
+~ if (f1 == NULL || f2 == NULL) {
+~ printf("ERROR OPENING FILE");
+~ exit(EXIT_FAILURE);
+~ }
+~
+~ char c1;
+~ while (1) {
+~ c1 = fgetc(f1);
+ fputc(c1, f2); // focus
+~ if (c1 == EOF) { // EOF has been written to f2 and now loop needs to be stopped
+~ break;
+~ }
+~ }
+~
+~ fclose(f1), fclose(f2);
+~} // DONE
+```
+
+***
+
+## 4. Write a C program to count characters, words and lines in a text file.
+
+input->
+
+```
+I love programming.
+Working with files in C programming is fun.
+I am learning C programming at KU.
+```
+
+Output->
+
+```
+Total characters = 106
+Total words = 18
+Total lines = 3
+```
+
+***
+
+## 5. Write a C program to remove a word from text file.
+
+file.txt
+
+```
+I love programming.
+Programming with MM Sir is fun.
+Learning C programming at KU is simple and easy.
+```
+
+Take input from user.
+
+***
+
+## 6. Write a C program to remove specific line from a text file.
+
+file.txt
+
+```
+I love programming.
+Programming with MM Sir fun.
+Learning C programming at KU is simple and easy.
+```
+
+take input from User
+
+***
+
+## 7. Write a C program to remove empty lines from a text file.
+
+file.txt
+
+```
+
+
+I love programming.
+
+
+
+Programming with files fun.
+
+Learning C programming at Codeforwin simple and easy.
+
+```
+
+***
+
+## 8. Write a C program to find and replace a word in a text file.
+
+file.txt
+
+```
+I love programming.
+Programming with files is fun.
+Learning C programming at KU is simple and easy.
+```
+
+replace "file" with "chatgpt"
+
+***
+
+## 9. Write a C program to count occurrences of all words in a text file.
+
+file.txt
+
+```
+I love programming.
+Programming with files is so fun.
+Learning C programming at KU is so simple and easy.
+```
+
+take input from User
+
+***
+
+## 10. Write a C program to convert uppercase to lowercase character and vice versa in a text file.
+
+file.txt
+
+```
+I love programming.
+---------PROGRAMMING IN C---------
+Learning C programming at KU is simple and easy.
+```
+
+output->
+
+```
+i LOVE PROGRAMMING.
+---------programming in c---------
+lEARNING c PROGRAMMING AT ku IS SIMPLE AND EASY.
+```
+
+***
+
+## NOTE: the following four questions are previous lab test questions set by Dr Manishankar Mondal Sir on Strings. We have modified them to introduce file handling concepts.
+
+## 11. Write a program that takes a file containing string with spaces from the user. Your program will then determine the following and save them in txt files.
+
+1. Find the individual words and store them in a two-dimensional array. Save the words.
+2. Count the number of vowels in each word. Save the counts for all words in a file.
+3. Print the appearance counts of the distinct words? Draw a histogram considering the appearance counts and save them in another file.
+
+Sample Input file `input.txt`:
+
+```
+I know the man. the man is a good human being. the man has good characteristics. man man man man the the the the good good
+```
+
+First Output file:
+
+```
+I, vowel count = 1
+know, vowel count = 1
+the, vowel count = 1
+man, vowel count = 1
+the, vowel count = 1
+man, vowel count = 1
+is, vowel count = 1
+a, vowel count = 1
+good, vowel count = 2
+human, vowel count = 2
+being, vowel count = 2
+the, vowel count = 1
+man, vowel count = 1
+has, vowel count = 1
+good, vowel count = 2
+characteristics, vowel count = 5
+man, vowel count = 1
+man, vowel count = 1
+man, vowel count = 1
+man, vowel count = 1
+the, vowel count = 1
+the, vowel count = 1
+the, vowel count = 1
+the, vowel count = 1
+good, vowel count = 2
+good, vowel count = 2
+```
+
+Second output file `distinct_words_appearance_counts.txt`:
+
+```
+I: *
+know: *
+the: ***
+man: ***
+is: *
+a: *
+good: ****
+human: *
+being: *
+has: *
+characteristics: *
+```
+
+***
+
+## 12. Assume that you have an array of 20 positive integers in a file. Write a program to RECURSIVELY determine the SUMMATION of all prime integers in the array. You SHOULD write the prime testing function recursively. The array will be taken as input from file and append the answer to the input file at last.
+
+input.txt
+
+```
+4
+345
+45
+78
+324
+5
+45
+453
+435
+37
+78
+423
+453
+34
+578
+31
+374
+19
+11
+111
+```
+
+output:
+
+```
+4
+345
+45
+78
+324
+5
+45
+453
+435
+37
+78
+423
+453
+34
+578
+31
+374
+19
+11
+111
+sum:103
+```
+
+***
+
+## 13. Write a program to take a string with spaces from a file. Your program will save the string to `output.txt` after trimming it. Let us assume that the input string is " I live in a beautiful village. ". Your program will remove the spaces from the front and back of the string and then save it. Thus, the output will be "I live in a beautiful village." For trimming (i.e., for removing spaces from the front and back) you need to create a user-defined function called "trimstring" that takes a string as a parameter.
+
+***
+
+## 14. "LTrim", "RTrim", and "MTrim", and "CountOccurrence"
+
+Write a program that will take a string with spaces from file as input. Write four functions named "LTrim", "RTrim", and "MTrim", and "CountOccurrence". Each of these functions will take a string as a parameter.
+
+"LTrim" will delete all the spaces from the left hand side of the parameter string and will return the string that will be obtained after deleting the left side spaces.
+
+"RTrim" will delete all the spaces from the right hand side of the parameter string and will return the string that will be obtained after deleting the right side spaces.
+
+"MTrim" will keep only one space between every two consecutive words. There can be multiple spaces between two words in a string. Only one space will be kept and other spaces will be deleted.
+
+And, "CountOccurrence" will recursively count the occurrences of "abc" in a parameter string and will return the count. This function might also take other parameters as you wish to accomplish the task.
diff --git a/src/SUMMARY.md b/src/SUMMARY.md
index 1509209..7e89e16 100644
--- a/src/SUMMARY.md
+++ b/src/SUMMARY.md
@@ -46,6 +46,7 @@
* [Linked List](./LinkedList/LinkedList.md)
* [int main(int argc, char \*argv\[\])](./int_main_argc_argv/int_main_argc_argv.md)
* [File Operations](./FileOperations/FileOperations.md)
+ * [Practice Problems](./FileOperations/FileOperationsPracticeProblems.md)
***
diff --git a/src/StartHere/Books_Tutorials.md b/src/StartHere/Books_Tutorials.md
index 125d082..643868b 100644
--- a/src/StartHere/Books_Tutorials.md
+++ b/src/StartHere/Books_Tutorials.md
@@ -1,12 +1,15 @@
-# Books & Tutorials
+# Learning Resources
+
+> *A gentle reminder...*\
+> This book is prepared as a supplement to your mainstream learning resource (like Youtube Playlist or any Bangladeshi Book). After Completing topics from your main learning source, you can find additional knowledge and practice problems here. Do not take this book as your main book to learn as we have skipped many things believing that you will learn them in your class or youtube lecture.
Now let's get you started on your learning journey. Choose any of the following ones to start. If you love to read and you can understand well from reading then you may choose option 1. Otherwise choose the other options. (Those are videos. I'll suggest that you try both and then decide.)
-| Author/Channel Name | Medium | Link |
+| Resource | Medium | Link |
| - | - | - |
-| Harvard CS50 | English (Youtube Playlist[^note]) | [Playlist](https://youtube.com/playlist?list=PLhQjrBD2T381WAHyx1pq-sBfykqMBI7V4\&si=45C8iSl3q8JbDCvB) |
+| Harvard CS50 | English (Youtube Playlist | [Playlist](https://youtube.com/playlist?list=PLhQjrBD2T381WAHyx1pq-sBfykqMBI7V4\&si=45C8iSl3q8JbDCvB) |
| Tamim Shahriar Subeen | Bangla (Book) | [CPBook](http://cpbook.subeen.com/) |
-| Anisul Islam | Bangla (Video) | [C Programming](https://www.youtube.com/playlist?list=PLgH5QX0i9K3pCMBZcul1fta6UivHDbXvz) |
+| Anisul Islam Youtube Playlist | Bangla (Video) | [C Programming](https://www.youtube.com/playlist?list=PLgH5QX0i9K3pCMBZcul1fta6UivHDbXvz) |
How to Start C (Resources)
Firstly, watch Harvard CS50 to build up concepts. It is Highly Recommended for Basics.
@@ -18,6 +21,6 @@ More Resources:
MIT OpenCourseWare
https://nptel.ac.in
----
+***
-[^note]: If you want to download a whole youtube playlist with subtitle, you can check this [link](https://blogofkazirifatjr.blogspot.com/2024/08/techtalk01-better-uu-d-dnld.html).
+*If you want to download a whole youtube playlist with subtitle, you can check this [link](https://blogofkazirifatjr.blogspot.com/2024/08/techtalk01-better-uu-d-dnld.html).*
diff --git a/src/ending/Contributions.md b/src/ending/Contributions.md
index af39c28..c25b108 100644
--- a/src/ending/Contributions.md
+++ b/src/ending/Contributions.md
@@ -8,7 +8,7 @@
During our 1st year 2nd term, me along with my close 3 friends felt necessity of collaboration and assistance to start programming life for beginners. We decided to help our
-After our term final examination, during Eid Vacation, my friend, [Ibnul Abrar Shahriar Seam](https://t.me/Anonymous_HF) sent me a link and added me as a contributor. Later, my classmates [Azmain Inquaid Haque](https://www.linkedin.com/in/azmain-inquaid-haque-44a4b62b1/), and [Joydeb Gan Prokas (Durjay)](mailto:durjaynwrx7@gmail.com) directly contributed to this book.
+After our term final examination, during Eid Vacation, my friend, [Ibnul Abrar Shahriar Seam](https://t.me/Anonymous_HF) sent me a link and added me as a contributor. Later, my classmates [Azmain Inquaid Haque](https://www.linkedin.com/in/azmain-inquaid-haque-44a4b62b1/), and [Joydeb Gan Prokas (Durjay)](https://www.linkedin.com/in/joydeb-gan-prokas-a33667286/) directly contributed to this book.
Later, [a lot happened](https://en.wikipedia.org/wiki/2024_Bangladesh_quota_reform_movement), we achieved the 2nd independence of Bangladesh on "36th July 2024" (05 August 2024) with the heroic patriotism of [Abu Sayed Vai](https://youtu.be/FdwWlU4SSjs?si=dp10wmAFPP5FXAfE), [Mir Mugdha Vai](https://youtu.be/S08aMjlgfis?si=oQB7oA6UuWj_DWrn), [and many more](https://en.prothomalo.com/bangladesh/1hmcovbabm) which motivated us to share our knowledge and thoughts to build this nation. To make it freely available for everyone and everyone's contribution, we decided to make it open by hosting in Github with mdBook.
diff --git a/src/welcome.md b/src/welcome.md
index b821566..223c13a 100644
--- a/src/welcome.md
+++ b/src/welcome.md
@@ -7,3 +7,5 @@ Welcome to Vitamin C Programming Supplement. It is a guide like book for program
We have tried to make this contest easy as possible from Bangladeshi POV and written exams. As well as we will be sharing our notes on Programming fundamentals and the C programming language.
It takes a lot of time to mastery a programming language. You need to p
+
+This book is prepared as a supplement to your mainstream learning resource (like Youtube Playlist or any Bangladeshi Book). After Completing topics from your main learning source, you can find additional knowledge and practice problems here. Do not take this book as your main book to learn as we have skipped many things believing that you will learn them in your class or youtube lecture.