├── .gitignore ├── .vscode └── settings.json ├── 01_basic ├── 01 _helloWorld.c ├── 02_findTheAverage.c ├── 03_areaOfSquare.c ├── 04_areaOfCircle.c ├── 05_volumeOfCube.c ├── 06_perimeterOfRectangle.c └── 07_findTheSmallest.c ├── 02_conditional_statements ├── 01_evenOrOdd.c ├── 02_positiveOrNegative.c ├── 03_gradingSystem.c ├── 04_leapYear.c ├── 05_naturalNumber.c ├── 06_largestAmongThree.c ├── 07_vowelOrConsonant.c └── 08_dayOfTheWeek.c ├── 03_loops ├── 02_takingNumbers.c ├── 03_tableOfNumber.c ├── 04_reverseTableOfNumber.c ├── 06.1_factorial.c ├── 06_sumOfNaturalNumber.c ├── 07_starPatternSquare.c └── 08_armstrongNumber.c ├── 04_functions ├── nthFibonacciNumber.c ├── pow.c ├── recursion.c └── sumOfDigit.c ├── 05_arrays ├── 01_traverseArray.c ├── 02_countOdd.c ├── 03_howManyTimesOccurs.c ├── 04_largestNumberInArray.c ├── 05_storeFibonacci.c ├── 06_reverseArray.c ├── 07_2dArray.c ├── 08_sumIn2d.c ├── 09_transpose2d.c ├── 10_maxMin2d.c └── 11_functionArgument.c ├── 06_pointer ├── 01_index.c ├── 02_printAlphabets.c ├── 03_callBy.c ├── 04_multipleReturns.c └── 05_swapNumbers.c ├── 07_strings ├── 01_index.c ├── 02_inputString.c ├── 03_lengthOfString.c ├── 04_salting.c ├── 05_functions.c └── 06_stringLibrary.c ├── 08_structure&union ├── 01_index.c ├── 02_arrayOfStructures.c ├── 03_addresses.c ├── 04_sumOfVectors.c ├── 05_complexNumbers.c └── 06_college_data.c ├── 09_file_IO ├── 01_index.c ├── 02_inputFromAUser.c ├── 03_writeOddNumbers.c ├── 04_replaceValue.c └── file.txt ├── 10_dynamic_memory_allocation └── 01_index.c └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !*.* 3 | *.exe 4 | !*/ 5 | !*/*.* 6 | */*.exe 7 | ex.* 8 | main.* -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "stdio.h": "c" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /01_basic/01 _helloWorld.c: -------------------------------------------------------------------------------- 1 | // print hello world 2 | #include 3 | 4 | int main() 5 | { 6 | printf("Hello World!\n"); 7 | return 0; 8 | } -------------------------------------------------------------------------------- /01_basic/02_findTheAverage.c: -------------------------------------------------------------------------------- 1 | // take three numbers and calculate the average of three numbers 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | float a, b, c; 8 | printf("enter number a \n"); 9 | scanf("%f", &a); 10 | printf("enter number b \n"); 11 | scanf("%f", &b); 12 | printf("enter number c \n"); 13 | scanf("%f", &c); 14 | float average = (a + b + c) / 3; 15 | printf("average is %f\n", average); 16 | return 0; 17 | } -------------------------------------------------------------------------------- /01_basic/03_areaOfSquare.c: -------------------------------------------------------------------------------- 1 | // find the area of square 2 | #include 3 | int main() 4 | { 5 | float side; 6 | printf("enter the side of the square \n"); 7 | scanf("%f", &side); 8 | float area = side * side; 9 | printf("the area of the square is %f\n", area); 10 | return 0; 11 | } -------------------------------------------------------------------------------- /01_basic/04_areaOfCircle.c: -------------------------------------------------------------------------------- 1 | // find the area of circle 2 | #include 3 | #define PI 3.14 4 | int main() 5 | { 6 | float radius; 7 | printf("enter radius: "); 8 | scanf("%f", &radius); 9 | float area = PI * radius * radius; 10 | printf("area is %f\n", area); 11 | return 0; 12 | } -------------------------------------------------------------------------------- /01_basic/05_volumeOfCube.c: -------------------------------------------------------------------------------- 1 | // find the volume of a cube 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | float side; 8 | printf("enter side of cube: "); 9 | scanf("%f", &side); 10 | float volume = pow(side, 3); 11 | printf("volume of cude is : %.2f\n", volume); 12 | return 0; 13 | } -------------------------------------------------------------------------------- /01_basic/06_perimeterOfRectangle.c: -------------------------------------------------------------------------------- 1 | // find the perimeter of a rectangle 2 | #include 3 | int main() 4 | { 5 | float length, width; 6 | printf("enter length: "); 7 | scanf("%f", &length); 8 | printf("enter width: "); 9 | scanf("%f", &width); 10 | float perimeter = 2 * (length + width); 11 | printf("perimeter is %f\n", perimeter); 12 | return 0; 13 | } -------------------------------------------------------------------------------- /01_basic/07_findTheSmallest.c: -------------------------------------------------------------------------------- 1 | // find the smaller number only using arithmetic and relational operator 2 | #include 3 | 4 | int main() 5 | { 6 | int a, b; 7 | printf("enter a: "); 8 | scanf("%d", &a); 9 | printf("enter b: "); 10 | scanf("%d", &b); 11 | 12 | int smaller = (a < b) * a + (b < a) * b; 13 | 14 | printf("smaller number is : %d\n", smaller); 15 | return 0; 16 | } -------------------------------------------------------------------------------- /02_conditional_statements/01_evenOrOdd.c: -------------------------------------------------------------------------------- 1 | // Create a C program that checks if a given integer is even or odd.Print "Even" or "Odd" accordingly. 2 | #include 3 | 4 | int main() 5 | { 6 | int a; 7 | printf("enter a number: "); 8 | scanf("%d", &a); 9 | 10 | if (a % 2 == 0) 11 | { 12 | printf("you entered a even number\n"); 13 | } 14 | else 15 | { 16 | printf("you entered a odd number\n"); 17 | } 18 | 19 | return 0; 20 | } -------------------------------------------------------------------------------- /02_conditional_statements/02_positiveOrNegative.c: -------------------------------------------------------------------------------- 1 | // Write a C program that takes an integer as input and prints "Positive" if it's greater than zero, "Negative" if it's less than zero, and "Zero" if it's equal to zero. 2 | #include 3 | 4 | int main() 5 | { 6 | int a; 7 | printf("enter a number: "); 8 | scanf("%d", &a); 9 | 10 | if (a > 0) 11 | { 12 | printf("you entered a positive number\n"); 13 | } 14 | else if (a < 0) 15 | { 16 | printf("you entered a negative number\n"); 17 | } 18 | else 19 | { 20 | printf("you entered zero\n"); 21 | } 22 | 23 | return 0; 24 | } -------------------------------------------------------------------------------- /02_conditional_statements/03_gradingSystem.c: -------------------------------------------------------------------------------- 1 | // Implement a C program that takes a student's score as input and assigns a grade based on the following criteria:90 -100 : A, 80 - 89 : B, 70 - 79 : C, 60 - 69 : D, Below 60 : F 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | int score; 8 | printf("enter your score: "); 9 | scanf("%d", &score); 10 | if (score <= 100 && score >= 0) 11 | { 12 | if (score >= 90) 13 | { 14 | printf("A\n"); 15 | } 16 | else if (score >= 80) 17 | { 18 | printf("B\n"); 19 | } 20 | else if (score >= 70) 21 | { 22 | printf("C\n"); 23 | } 24 | else if (score >= 60) 25 | { 26 | printf("D\n"); 27 | } 28 | else 29 | { 30 | printf("you are fail\n"); 31 | } 32 | } 33 | else 34 | { 35 | printf("you enter invalid score, score must be 0-100\n"); 36 | } 37 | 38 | return 0; 39 | } -------------------------------------------------------------------------------- /02_conditional_statements/04_leapYear.c: -------------------------------------------------------------------------------- 1 | // Write a C program to determine if a given year is a leap year. Leap years are divisible by 4, except for those divisible by 100 but not by 400. 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | int year; 8 | printf("enter the year: "); 9 | scanf("%d", &year); 10 | 11 | if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) 12 | { 13 | printf("this is a leap year\n"); 14 | } 15 | else 16 | { 17 | printf("it is not a leap year.\n"); 18 | } 19 | 20 | return 0; 21 | } -------------------------------------------------------------------------------- /02_conditional_statements/05_naturalNumber.c: -------------------------------------------------------------------------------- 1 | // take a input from user and check wheter a number is a natural number or not 2 | #include 3 | 4 | int main() 5 | { 6 | int a; 7 | float given_number; 8 | printf("enter number: "); 9 | scanf("%f", &given_number); 10 | a = given_number; 11 | if (given_number > 0 && given_number - a == 0) 12 | { 13 | printf("the number is a natural number\n"); 14 | } 15 | else 16 | { 17 | printf("the number is not a natural number\n"); 18 | } 19 | 20 | return 0; 21 | } -------------------------------------------------------------------------------- /02_conditional_statements/06_largestAmongThree.c: -------------------------------------------------------------------------------- 1 | // Create a C program that takes three integers as input and finds the maximum of the three using if - else statements. 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | int a, b, c; 8 | printf("enter three numbers: "); 9 | scanf("%d %d %d", &a, &b, &c); 10 | if (a > b) 11 | { 12 | if (a > c) 13 | { 14 | printf("%d is largest\n", a); 15 | } 16 | else 17 | { 18 | printf("%d is largest\n", c); 19 | } 20 | } 21 | else 22 | { 23 | if (b > c) 24 | { 25 | printf("%d is largest\n", b); 26 | } 27 | else 28 | { 29 | printf("%d is largest\n", c); 30 | } 31 | } 32 | return 0; 33 | } -------------------------------------------------------------------------------- /02_conditional_statements/07_vowelOrConsonant.c: -------------------------------------------------------------------------------- 1 | // Write a C program that takes a character as input and checks if it's a vowel (a, e, i, o, u) or a consonant. 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | char ch; 8 | printf("enter a caracter: "); 9 | scanf("%c", &ch); 10 | switch (ch) 11 | { 12 | case 'a': 13 | case 'A': 14 | printf("this is a vowel\n"); 15 | break; 16 | case 'e': 17 | case 'E': 18 | printf("this is a vowel\n"); 19 | 20 | break; 21 | case 'i': 22 | case 'I': 23 | printf("this is a vowel\n"); 24 | break; 25 | case 'o': 26 | case 'O': 27 | printf("this is a vowel\n"); 28 | break; 29 | case 'u': 30 | case 'U': 31 | printf("this is a vowel\n"); 32 | break; 33 | 34 | default: 35 | printf("this is not a vowel\n"); 36 | break; 37 | } 38 | return 0; 39 | } -------------------------------------------------------------------------------- /02_conditional_statements/08_dayOfTheWeek.c: -------------------------------------------------------------------------------- 1 | // Write a C program that takes an integer (1-7) as input and uses a switch statement to print the corresponding day of the week (e.g., 1 for "Sunday," 2 for "Monday," etc.). 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | int a; 8 | printf("enter a number between 1 - 7: "); 9 | scanf("%d", &a); 10 | switch (a) 11 | { 12 | case 1: 13 | printf("sunday\n"); 14 | break; 15 | case 2: 16 | printf("monday\n"); 17 | break; 18 | case 3: 19 | printf("tuesday\n"); 20 | break; 21 | case 4: 22 | printf("wednesday\n"); 23 | break; 24 | case 5: 25 | printf("thursday\n"); 26 | break; 27 | case 6: 28 | printf("friday\n"); 29 | break; 30 | case 7: 31 | printf("saturday\n"); 32 | break; 33 | 34 | default: 35 | printf("a week has only seven day\n"); 36 | break; 37 | } 38 | return 0; 39 | } -------------------------------------------------------------------------------- /03_loops/02_takingNumbers.c: -------------------------------------------------------------------------------- 1 | // keep taking numbers from user until user gave a odd number 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | int a; 8 | do 9 | { 10 | printf("enter number\n"); 11 | scanf("%d", &a); 12 | } while (a % 2 == 0); 13 | 14 | printf("end\n"); 15 | return 0; 16 | } -------------------------------------------------------------------------------- /03_loops/03_tableOfNumber.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a; 6 | printf("enter number\n"); 7 | scanf("%d", &a); 8 | 9 | for (int i = 1; i <= 10; i++) 10 | { 11 | printf("%d * %d = %d\n", a, i, a * i); 12 | } 13 | 14 | return 0; 15 | } -------------------------------------------------------------------------------- /03_loops/04_reverseTableOfNumber.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int given_number; 6 | printf("enter number\n"); 7 | scanf("%d", &given_number); 8 | 9 | for (int i = 10; i > 0; i--) 10 | { 11 | printf("%d * %d = %d\n", given_number, i, given_number * i); 12 | } 13 | 14 | return 0; 15 | } -------------------------------------------------------------------------------- /03_loops/06.1_factorial.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | printf("enter number: "); 7 | scanf("%d", &n); 8 | int product = 1; 9 | for (int i = 1; i <= n; i++) 10 | { 11 | product *= i; 12 | } 13 | 14 | printf("factorial of %d is %d\n", n, product); 15 | 16 | return 0; 17 | } -------------------------------------------------------------------------------- /03_loops/06_sumOfNaturalNumber.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a; 6 | printf("enter a natural number: "); 7 | scanf("%d", &a); 8 | 9 | int sum = 0; 10 | 11 | for (int i = 1, j = a; i <= a; i++, j--) 12 | { 13 | 14 | sum += i; 15 | } 16 | 17 | printf("%d\n", sum); 18 | 19 | return 0; 20 | } -------------------------------------------------------------------------------- /03_loops/07_starPatternSquare.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void square() 4 | { 5 | 6 | for (int i = 0; i < 4; i++) 7 | { 8 | for (int i = 0; i < 4; i++) 9 | { 10 | printf("* "); 11 | } 12 | printf("\n"); 13 | } 14 | } 15 | 16 | void rightAngledTriangle() 17 | { 18 | for (int i = 0; i <= 7; i++) 19 | { 20 | 21 | for (int a = 0; a <= i; a++) 22 | { 23 | printf("* "); 24 | } 25 | 26 | printf("\n"); 27 | } 28 | } 29 | 30 | int main() 31 | { 32 | square(); 33 | rightAngledTriangle(); 34 | return 0; 35 | } -------------------------------------------------------------------------------- /03_loops/08_armstrongNumber.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int given_number, modulas, temp, sum = 0; 6 | 7 | printf("enter a number: \n"); 8 | scanf("%d", &given_number); 9 | temp = given_number; 10 | 11 | while (given_number > 0) 12 | { 13 | modulas = given_number % 10; 14 | sum += (modulas * modulas * modulas); 15 | given_number /= 10; 16 | } 17 | 18 | if (temp == sum) 19 | { 20 | printf("armstrong number\n"); 21 | } 22 | else 23 | { 24 | printf("not a armstrong number\n"); 25 | } 26 | 27 | return 0; 28 | } -------------------------------------------------------------------------------- /04_functions/nthFibonacciNumber.c: -------------------------------------------------------------------------------- 1 | // print the nth term of fibonacci numbers 2 | 3 | #include 4 | 5 | int fib(int a); 6 | int fibf(int n); 7 | 8 | int main() 9 | { 10 | int a = 8; 11 | printf("the %dth of fibonacci number is %d\n", a, fib(a)); 12 | 13 | return 0; 14 | } 15 | 16 | int fib(int a) 17 | { 18 | if (a == 1 || a == 2) 19 | { 20 | return a - 1; 21 | } 22 | 23 | int prevN = fib(a - 1) + fib(a - 2); 24 | 25 | return prevN; 26 | } 27 | 28 | int fibf(int n) 29 | { 30 | if (n == 0 || n == 1) 31 | { 32 | return n; 33 | } 34 | int new, cur = 1, prev = 0; 35 | for (int i = 3; i <= n; i++) 36 | { 37 | new = cur + prev; 38 | prev = cur; 39 | cur = new; 40 | } 41 | 42 | return new; 43 | } -------------------------------------------------------------------------------- /04_functions/pow.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int power(int number, int power); 4 | 5 | int main() 6 | { 7 | printf("%d\n", power(12, 2)); 8 | return 0; 9 | } 10 | 11 | int power(int number, int power) 12 | { 13 | int res = 1; 14 | for (int i = power; i >= 1; i--) 15 | { 16 | res *= number; 17 | } 18 | return res; 19 | } -------------------------------------------------------------------------------- /04_functions/recursion.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void printHello(int count); 4 | int sum(int n); 5 | int factorial(int n); 6 | 7 | int main() 8 | { 9 | 10 | return 0; 11 | } 12 | 13 | void printHello(int count) 14 | { 15 | if (count == 0) 16 | { 17 | return; 18 | } 19 | printf("hello\n"); 20 | printHello(count - 1); 21 | } 22 | 23 | int sum(int n) 24 | { 25 | if (n == 1) 26 | { 27 | return 1; 28 | } 29 | 30 | int sumNm1 = sum(n - 1); 31 | int sumN = sumNm1 + n; 32 | return sumN; 33 | } 34 | 35 | int factorial(int n) 36 | { 37 | if (n == 1) 38 | { 39 | return 1; 40 | } 41 | 42 | int facNm1 = factorial(n - 1); 43 | 44 | int fac = facNm1 * n; 45 | 46 | return fac; 47 | } 48 | -------------------------------------------------------------------------------- /04_functions/sumOfDigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | int sum(int a); 3 | int main() 4 | { 5 | int n; 6 | printf("enter a integer: "); 7 | scanf("%d", &n); 8 | printf("sum of digits = %d\n", sum(n)); 9 | return 0; 10 | } 11 | int sum(int a) 12 | { 13 | int sum = 0; 14 | while (a != 0) 15 | { 16 | int m = a % 10; 17 | sum = sum + m; 18 | a = a / 10; 19 | } 20 | return sum; 21 | } -------------------------------------------------------------------------------- /05_arrays/01_traverseArray.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; 6 | 7 | int *ptr = arr; // or int *ptr = &arr[0] 8 | 9 | for (int i = 0; i < 10; i++) 10 | { 11 | printf("%d\n", *ptr + i); 12 | } 13 | 14 | return 0; 15 | } -------------------------------------------------------------------------------- /05_arrays/02_countOdd.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int countOdd(int arr[], int n); 4 | 5 | int main() 6 | { 7 | int arr[] = {1, 2, 3, 4, 5}; 8 | printf("odd numbers are %d\n", countOdd(arr, 5)); 9 | 10 | return 0; 11 | } 12 | int countOdd(int arr[], int n) 13 | { 14 | int count = 0; 15 | for (int i = 0; i < n; i++) 16 | { 17 | if ((arr[i] % 2) != 0) 18 | { 19 | count++; 20 | } 21 | } 22 | 23 | return count; 24 | } -------------------------------------------------------------------------------- /05_arrays/03_howManyTimesOccurs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | printf("enter a number: "); 7 | scanf("%d", &n); 8 | 9 | int arr[] = {1, 5, 6, 2, 4, 7, 8, 9, 5, 4, 8, 6, 1, 2, 3, 5, 4, 7, 8, 9, 5, 4, 1, 2, 6, 5, 3, 2, 1, 4, 5, 9, 7, 8, 4, 5, 1, 6, 2, 5, 3, 1, 4, 7, 8}; 10 | 11 | int count = 0; 12 | for (int i = 0; i < 45; i++) 13 | { 14 | if (n == arr[i]) 15 | { 16 | count++; 17 | } 18 | } 19 | 20 | printf("%d occurs %d times.\n", n, count); 21 | 22 | return 0; 23 | } -------------------------------------------------------------------------------- /05_arrays/04_largestNumberInArray.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int arr[] = {1, 2, 5, 4, 7, 9, 6, 5, 4, 25, 45, 12}; 6 | int max = arr[0]; 7 | 8 | for (int i = 0; i < 12; i++) 9 | { 10 | if (max < arr[i]) 11 | { 12 | max = arr[i]; 13 | printf("%d\n", max); 14 | } 15 | } 16 | printf("largest number is %d\n", max); 17 | 18 | return 0; 19 | } -------------------------------------------------------------------------------- /05_arrays/05_storeFibonacci.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | printf("enter n (n>2): "); 7 | scanf("%d", &n); 8 | 9 | int fib[n]; 10 | fib[0] = 0; 11 | fib[1] = 1; 12 | printf("%d\t", fib[0]); 13 | printf("%d\t", fib[1]); 14 | for (int i = 2; i < n; i++) 15 | { 16 | fib[i] = fib[i - 1] + fib[i - 2]; 17 | printf("%d\t", fib[i]); 18 | } 19 | printf("\n"); 20 | 21 | return 0; 22 | } -------------------------------------------------------------------------------- /05_arrays/06_reverseArray.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int arr[] = {1, 2, 3, 4}; 6 | 7 | for (int i = 0; i < 4; i++) 8 | { 9 | printf("%d", arr[i]); 10 | } 11 | printf("\n-------\n"); 12 | for (int i = 0; i < 4 / 2; i++) 13 | { 14 | int tempValue = arr[i]; 15 | arr[i] = arr[4 - i - 1]; 16 | arr[4 - i - 1] = tempValue; 17 | } 18 | 19 | for (int i = 0; i < 4; i++) 20 | { 21 | printf("%d", arr[i]); 22 | } 23 | printf("\n"); 24 | return 0; 25 | } -------------------------------------------------------------------------------- /05_arrays/07_2dArray.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | // declear a 2d array 6 | int arr[2][3] = {{2, 4, 5}, {3, 6, 9}}; 7 | 8 | // reassign value 9 | arr[0][1] = 3; 10 | 11 | // access a 2d array 12 | printf("%d\n", arr[0][2]); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /05_arrays/08_sumIn2d.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int arr[3][3] = { 6 | {3, 4, 2}, 7 | {5, 3, 7}, 8 | {4, 8, 2}}; 9 | int sum = 0; 10 | for (int i = 0; i < 3; i++) 11 | { 12 | for (int j = 0; j < 3; j++) 13 | { 14 | sum += arr[i][j]; 15 | } 16 | } 17 | 18 | printf("sum of all elements is %d\n", sum); 19 | return 0; 20 | } -------------------------------------------------------------------------------- /05_arrays/09_transpose2d.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int arr[4][4] = { 6 | {1, 2, 3, 4}, 7 | {5, 6, 7, 8}, 8 | {9, 10, 11, 12}, 9 | {13, 14, 15, 16}}; 10 | int tran[4][4]; 11 | 12 | for (int i = 0; i < 4; i++) 13 | { 14 | for (int j = 0; j < 4; j++) 15 | { 16 | printf("%d ", arr[i][j]); 17 | } 18 | printf("\n"); 19 | } 20 | printf("\n"); 21 | 22 | for (int i = 0; i < 4; i++) 23 | { 24 | for (int j = 0; j < 4; j++) 25 | { 26 | 27 | tran[j][i] = arr[i][j]; 28 | } 29 | } 30 | 31 | for (int i = 0; i < 4; i++) 32 | { 33 | for (int j = 0; j < 4; j++) 34 | { 35 | printf("%d ", tran[i][j]); 36 | } 37 | printf("\n"); 38 | } 39 | 40 | return 0; 41 | } -------------------------------------------------------------------------------- /05_arrays/10_maxMin2d.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int arr[4][4] = { 6 | {1, 2, 3, 4}, 7 | {5, 6, 7, 8}, 8 | {9, 10, 11, 12}, 9 | {13, 14, 15, 16}}; 10 | int max, min; 11 | max = min = arr[0][0]; 12 | for (int i = 0; i < 4; i++) 13 | { 14 | for (int j = 0; j < 4; j++) 15 | { 16 | if (arr[i][j] > max) 17 | { 18 | max = arr[i][j]; 19 | } 20 | if (arr[i][j] < min) 21 | { 22 | min = arr[i][j]; 23 | } 24 | } 25 | } 26 | printf("the max value is %d \n min value %d\n", max, min); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /05_arrays/11_functionArgument.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void printNumbers(int arr[], int n); 4 | 5 | int main() 6 | { 7 | int arr[] = {1, 2, 3, 4, 5}; 8 | printNumbers(arr, 5); 9 | return 0; 10 | } 11 | void printNumbers(int arr[], int n) 12 | { 13 | for (int i = 0; i < n; i++) 14 | { 15 | printf("%d ", arr[i]); 16 | } 17 | printf("\n"); 18 | } -------------------------------------------------------------------------------- /06_pointer/01_index.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int *ptr; 7 | int a = 2; 8 | ptr = &a; 9 | 10 | printf("%d\n", *ptr); 11 | printf("%d\n", a); 12 | 13 | printf("addres of a is %u\n", &a); 14 | printf("addres of a is %u\n", ptr); 15 | 16 | int **pptr; 17 | pptr = &ptr; 18 | 19 | printf("%d\n", **pptr); 20 | return 0; 21 | } -------------------------------------------------------------------------------- /06_pointer/02_printAlphabets.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char alph[27]; 6 | char *ptr; 7 | ptr = alph; 8 | 9 | int i; 10 | for (i = 0; i < 26; i++) 11 | { 12 | *ptr = i + 'A'; 13 | ptr++; 14 | } 15 | 16 | ptr = alph; 17 | 18 | for (i = 0; i < 26; i++) 19 | { 20 | printf("%c ", *ptr); 21 | ptr++; 22 | } 23 | 24 | return (0); 25 | } 26 | -------------------------------------------------------------------------------- /06_pointer/03_callBy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void callByValue(int a); 4 | void callByReference(int *a); 5 | 6 | int main() 7 | { 8 | int a = 2; 9 | 10 | callByValue(a); 11 | printf("a is %d\n", a); 12 | 13 | callByReference(&a); 14 | printf("a is %d\n", a); 15 | 16 | return 0; 17 | } 18 | 19 | void callByValue(int a) 20 | { 21 | a = a * 2; 22 | } 23 | void callByReference(int *a) 24 | { 25 | *a = *a * 2; 26 | } -------------------------------------------------------------------------------- /06_pointer/04_multipleReturns.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void doWork(int a, int b, int *sum, int *prod, int *avg); 4 | 5 | int main() 6 | { 7 | int a = 4, b = 7; 8 | int sum, prod, avg; 9 | 10 | doWork(a, b, &sum, &prod, &avg); 11 | 12 | printf("sum = %d, product = %d, average = %d \n", sum, prod, avg); 13 | return 0; 14 | } 15 | 16 | void doWork(int a, int b, int *sum, int *prod, int *avg) 17 | { 18 | *sum = a + b; 19 | *prod = a * b; 20 | *avg = (a + b) / 2; 21 | } -------------------------------------------------------------------------------- /06_pointer/05_swapNumbers.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void swap(int *a, int *b); 4 | 5 | int main() 6 | { 7 | int x = 5, y = 6; 8 | swap(&x, &y); 9 | printf("x = %d & y = %d\n", x, y); 10 | return 0; 11 | } 12 | 13 | // call by reference 14 | void swap(int *a, int *b) 15 | { 16 | int t = *a; 17 | *a = *b; 18 | *b = t; 19 | } -------------------------------------------------------------------------------- /07_strings/01_index.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void printString(char str[]); 4 | 5 | int main() 6 | { 7 | 8 | // char name[50]; 9 | // gets(name); // old and dangerous method 10 | // fgets(name, 50, stdin); //for input multiword strings 11 | // printf("your name is "); 12 | // puts(name); //for output multiword strings 13 | 14 | // char str[] = "Rahul"; 15 | // str = "subhankar"; //character array's are not chageable 16 | // NOT WORKING 17 | 18 | // char *str = "Rahul"; 19 | // str = "Subhankar"; 20 | // WORKING 21 | 22 | // char *str; 23 | // fgets(str, 20, stdin); 24 | // puts(str); 25 | // NOT WORKING 26 | 27 | return 0; 28 | } 29 | 30 | void printString(char str[]) 31 | { 32 | for (int i = 0; str[i] != '\0'; i++) 33 | { 34 | printf("%c", str[i]); 35 | } 36 | printf("\n"); 37 | } -------------------------------------------------------------------------------- /07_strings/02_inputString.c: -------------------------------------------------------------------------------- 1 | // input string by using %c 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | char str[10], ch; 8 | 9 | int i = 0; 10 | 11 | while (ch != '\n') 12 | { 13 | scanf("%c", &ch); 14 | str[i] = ch; 15 | i++; 16 | } 17 | str[i] = '\0'; 18 | puts(str); 19 | 20 | return 0; 21 | } -------------------------------------------------------------------------------- /07_strings/03_lengthOfString.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int len(char str[]); 5 | 6 | int main() 7 | { 8 | // char name[] = "subhankar"; 9 | char name[100]; 10 | fgets(name, 100, stdin); 11 | 12 | // int lenght = len(name); 13 | int lenght = strlen(name); 14 | printf("lenth of the string is %d\n", lenght); 15 | 16 | return 0; 17 | } 18 | int len(char str[]) 19 | { 20 | int i = 0; 21 | while (str[i] != '\0') 22 | { 23 | i++; 24 | } 25 | return i; 26 | } -------------------------------------------------------------------------------- /07_strings/04_salting.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char password[100]; 7 | printf("enter password: "); 8 | scanf("%s", password); 9 | 10 | char salt[] = "123"; 11 | 12 | char newPassword[200]; 13 | 14 | strcpy(newPassword, password); 15 | strcat(newPassword, salt); 16 | 17 | printf("new password is %s\n", newPassword); 18 | return 0; 19 | } -------------------------------------------------------------------------------- /07_strings/05_functions.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void slice(char str[], int n, int m); 6 | int countVowels(char str[]); 7 | bool isHave(char str[], char ch); 8 | 9 | int main() 10 | { 11 | char str[] = "helloWorld5"; 12 | printf("%d\n", isHave(str, '5')); 13 | return 0; 14 | } 15 | 16 | void slice(char str[], int n, int m) 17 | { 18 | char newstr[100]; 19 | for (int i = n, j = 0; i <= m; i++, j++) 20 | { 21 | newstr[j] = str[i]; 22 | } 23 | 24 | printf("%s\n", newstr); 25 | } 26 | 27 | int countVowels(char str[]) 28 | { 29 | int count = 0; 30 | for (int i = 0; str[i] != '\0'; i++) 31 | { 32 | if (str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' || str[i] == 'u') 33 | { 34 | count++; 35 | } 36 | } 37 | return count; 38 | } 39 | 40 | bool isHave(char str[], char ch) 41 | { 42 | bool is = 0; 43 | for (int i = 0; str[i] != '\0'; i++) 44 | { 45 | if (str[i] == ch) 46 | { 47 | is = 1; 48 | } 49 | } 50 | 51 | return is; 52 | } -------------------------------------------------------------------------------- /07_strings/06_stringLibrary.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | char name[] = "Rahul"; 8 | char str[] = "replaced"; 9 | char dum[] = "Dummy"; 10 | 11 | printf("length of the string is %d\n", (int)strlen(name)); 12 | 13 | printf("the new string replaced by %s\n", strcpy(str, name)); 14 | 15 | printf("concatenate two strings %s\n", strcat(name, str)); 16 | 17 | printf("compare two strings %d\n", strcmp(dum, name)); 18 | return 0; 19 | } -------------------------------------------------------------------------------- /08_structure&union/01_index.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | // structure is a user defined data type, a basic structure defined below 5 | struct student 6 | { 7 | char name[100]; 8 | int roll; 9 | float cgpa; 10 | }; 11 | 12 | // using typedef keyword to create a alias for structure data types 13 | typedef struct productsForResale 14 | { 15 | char title[200]; 16 | float price; 17 | 18 | } pfr; 19 | // go to line 55 20 | 21 | void printInfo(struct student s1); 22 | 23 | int main() 24 | { 25 | // create a new variable by structure 26 | struct student s1; 27 | 28 | // initialize structures values 29 | strcpy(s1.name, "Subhankar"); 30 | s1.roll = 01; 31 | s1.cgpa = 7.3; 32 | 33 | // alternet way to initialize structures values 34 | struct student s2 = {"Debyendu", 2, 7.0}; 35 | 36 | printf("name of student s1 is %s\n", s1.name); 37 | printf("roll of student s1 is %d\n", s1.roll); 38 | printf("cgpa of student s1 is %.1f\n", s1.cgpa); 39 | printf("\n"); 40 | printf("name of student s2 is %s\n", s2.name); 41 | printf("roll of student s2 is %d\n", s2.roll); 42 | printf("cgpa of student s2 is %.1f\n", s2.cgpa); 43 | 44 | // structure to pointers 45 | struct student *ptr = &s1; 46 | 47 | printf("\nname and cgpa of roll no. %d is: %s , %.1f\n", (*ptr).roll, (*ptr).name, (*ptr).cgpa); 48 | 49 | // arrow operator 50 | printf("name and cgpa of roll no. %d is: %s , %.1f\n", ptr->roll, ptr->name, ptr->cgpa); 51 | 52 | // passing structure as a function argument 53 | printInfo(s1); 54 | 55 | pfr p1 = {"book", 12.9}; 56 | 57 | printf("\nprice of %s is %.2f\n", p1.title, p1.price); 58 | 59 | return 0; 60 | } 61 | 62 | void printInfo(struct student s1) 63 | { 64 | printf("name %s\n", s1.name); 65 | printf("roll %d\n", s1.roll); 66 | printf("cgpa %.1f\n", s1.cgpa); 67 | } 68 | 69 | /* 70 | 1. structures are stored in contiguous memory location 71 | 2. sturctures are saved us for saving to create too many variables 72 | */ -------------------------------------------------------------------------------- /08_structure&union/02_arrayOfStructures.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct student 5 | { 6 | char name[100]; 7 | int roll; 8 | float cgpa; 9 | }; 10 | 11 | int main() 12 | { 13 | struct student cse[100]; 14 | 15 | strcpy(cse[0].name, "Subhankar"); 16 | cse[0].roll = 1; 17 | cse[0].cgpa = 7.3; 18 | strcpy(cse[1].name, "Debyendu"); 19 | cse[1].roll = 2; 20 | cse[1].cgpa = 7.0; 21 | strcpy(cse[2].name, "Binoy"); 22 | cse[2].roll = 3; 23 | cse[2].cgpa = 7.5; 24 | 25 | for (int i = 0; i < 3; i++) 26 | { 27 | printf("name and cgpa of roll no. %d is: %s , %.1f\n", cse[i].roll, cse[i].name, cse[i].cgpa); 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /08_structure&union/03_addresses.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | typedef struct address 5 | { 6 | int houseNo; 7 | int block; 8 | char city[100]; 9 | char state[100]; 10 | } add; 11 | 12 | void printInfo(struct address a); 13 | 14 | int main() 15 | { 16 | 17 | add adrs[2]; 18 | 19 | printf("enter info for person 1: "); 20 | scanf("%d", &adrs[0].houseNo); 21 | scanf("%d", &adrs[0].block); 22 | scanf("%s", adrs[0].city); 23 | scanf("%s", adrs[0].state); 24 | 25 | printf("enter info for person 2: "); 26 | scanf("%d", &adrs[1].houseNo); 27 | scanf("%d", &adrs[1].block); 28 | scanf("%s", adrs[1].city); 29 | scanf("%s", adrs[1].state); 30 | 31 | printInfo(adrs[0]); 32 | printInfo(adrs[1]); 33 | 34 | return 0; 35 | } 36 | 37 | void printInfo(struct address a) 38 | { 39 | printf("address of house no. %d is %d,%s,%s.\n", a.houseNo, a.block, a.city, a.state); 40 | } -------------------------------------------------------------------------------- /08_structure&union/04_sumOfVectors.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef struct vector 4 | { 5 | int x; 6 | int y; 7 | 8 | } vector; 9 | 10 | void calcSum(vector v1, vector v2, vector sum); 11 | 12 | int main() 13 | { 14 | vector v1 = {4, 8}; 15 | vector v2 = {3, 9}; 16 | 17 | vector sum = {0}; 18 | 19 | calcSum(v1, v2, sum); 20 | return 0; 21 | } 22 | 23 | void calcSum(vector v1, vector v2, vector sum) 24 | { 25 | sum.x = v1.x + v2.x; 26 | sum.y = v1.y + v2.y; 27 | 28 | printf("sum of two vector is %di + %dj\n", sum.x, sum.y); 29 | } -------------------------------------------------------------------------------- /08_structure&union/05_complexNumbers.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef struct complex 4 | { 5 | int real; 6 | int img; 7 | } complex; 8 | 9 | int main() 10 | { 11 | complex n1 = {5, 8}; 12 | complex *ptr = &n1; 13 | 14 | printf("real part : %d\n", ptr->real); 15 | printf("imaginary part : %d\n", ptr->img); 16 | return 0; 17 | } -------------------------------------------------------------------------------- /08_structure&union/06_college_data.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | typedef struct teacherData 4 | { 5 | char name[100]; 6 | char subject[100]; 7 | } td; 8 | 9 | typedef struct studentData 10 | { 11 | char name[100]; 12 | int roll; 13 | 14 | } sd; 15 | 16 | int main() 17 | { 18 | td teachers[100]; 19 | sd students[100]; 20 | 21 | strcpy(teachers[0].name, "Debashis Saha"); 22 | strcpy(teachers[0].subject, "Physics"); 23 | strcpy(teachers[1].name, "Manoj Saha"); 24 | strcpy(teachers[1].subject, "Mathematics"); 25 | strcpy(teachers[2].name, "Amit Kumar Basak"); 26 | strcpy(teachers[2].subject, "Biology"); 27 | 28 | strcpy(students[0].name, "Subhankar Rajbanshi"); 29 | students[0].roll = 1; 30 | strcpy(students[0].name, "Kishore Mondal"); 31 | students[1].roll = 2; 32 | 33 | printf("%s teacher is %s\n", teachers[0].subject, teachers[0].name); 34 | printf("%s's roll no. is %d\n", students[0].name, students[0].roll); 35 | 36 | return 0; 37 | } -------------------------------------------------------------------------------- /09_file_IO/01_index.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | // #create a file pointer 6 | FILE *fptr; 7 | 8 | // #open a file, first parameter is file name and second parameter is the mode 9 | fptr = fopen("file.txt", "w"); 10 | 11 | char c, c1; 12 | char string[100]; 13 | 14 | // #check if a file is exist or not, in write mode if a file doesn't exist it will create a file with the file name you provide. 15 | // if (fptr == NULL) 16 | // { 17 | // printf("file doesn't exist\n"); 18 | // } 19 | // else 20 | // { 21 | // printf("file exist\n"); 22 | // } 23 | 24 | // #read data, (character) 25 | // fscanf(fptr, "%c", &c); 26 | // printf("%c\n", c); 27 | 28 | // #write data (string) 29 | // fprintf(fptr, "%s", "this is a mango"); 30 | 31 | // #read a string using fgetc() 32 | // char ch; 33 | // ch = fgetc(fptr); 34 | 35 | // while (ch != EOF) 36 | // { 37 | // printf("%c", ch); 38 | // ch = fgetc(fptr); 39 | // } 40 | // printf("\n"); 41 | 42 | // #write a character using fputc 43 | // fputc('a', fptr); 44 | 45 | fclose(fptr); 46 | 47 | return 0; 48 | } 49 | 50 | /* 51 | #fopen modes- 1. "r" - to read file 52 | 2. "rb" - to read binary file 53 | 3. "w" - to write file 54 | 4. "wb" - to write binary file 55 | 5. "a" - to append something to a file 56 | */ -------------------------------------------------------------------------------- /09_file_IO/02_inputFromAUser.c: -------------------------------------------------------------------------------- 1 | // take input from a user and store it in a new text file 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | char name[100]; 8 | int age; 9 | 10 | printf("Enter your full name: "); 11 | fgets(name, sizeof(name), stdin); 12 | printf("enter age: "); 13 | scanf("%d", &age); 14 | 15 | FILE *fptr; 16 | fptr = fopen("file.txt", "w"); 17 | 18 | fprintf(fptr, "%s", name); 19 | fprintf(fptr, "%d", age); 20 | 21 | fclose(fptr); 22 | 23 | return 0; 24 | } -------------------------------------------------------------------------------- /09_file_IO/03_writeOddNumbers.c: -------------------------------------------------------------------------------- 1 | // write all odd numbers from 1 to n in a file 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | int n; 8 | printf("enter a number: "); 9 | scanf("%d", &n); 10 | 11 | FILE *fptr; 12 | 13 | fptr = fopen("file.txt", "w"); 14 | 15 | for (int i = 1; i <= n; i++) 16 | { 17 | if (i % 2 != 0) 18 | { 19 | fprintf(fptr, "%d\n", i); 20 | } 21 | } 22 | 23 | fclose(fptr); 24 | 25 | return 0; 26 | } -------------------------------------------------------------------------------- /09_file_IO/04_replaceValue.c: -------------------------------------------------------------------------------- 1 | // 2 numbers a & b, are written in a file. Write a progaram to replace them with their sum. 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | FILE *fptr; 8 | 9 | fptr = fopen("file.txt", "r"); 10 | 11 | int a, b; 12 | fscanf(fptr, "%d", &a); 13 | fscanf(fptr, "%d", &b); 14 | 15 | fclose(fptr); 16 | 17 | fptr = fopen("file.txt", "w"); 18 | 19 | fprintf(fptr, "%d", a + b); 20 | 21 | fclose(fptr); 22 | 23 | return 0; 24 | } -------------------------------------------------------------------------------- /09_file_IO/file.txt: -------------------------------------------------------------------------------- 1 | 13 15 -------------------------------------------------------------------------------- /10_dynamic_memory_allocation/01_index.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | // malloc using for allocate memory 8 | // int *ptr; 9 | // ptr = (int *)malloc(5 * sizeof(int)); 10 | 11 | // ptr[0] = 0; 12 | // ptr[1] = 1; 13 | // ptr[2] = 2; 14 | // ptr[3] = 3; 15 | // ptr[4] = 4; 16 | 17 | // for (int i = 0; i < 5; i++) 18 | // { 19 | // printf("%d\n", ptr[i]); 20 | // } 21 | 22 | // CALLOC USING FOR ALLOCATE CONTINUOUS MEMORY, AND IT INITIALIZE EVERY MEMORY WITH 0 23 | // int *ptr; 24 | // ptr = (int *)calloc(5, sizeof(int)); 25 | // ptr[0] = 0; 26 | // ptr[1] = 1; 27 | // ptr[2] = 2; 28 | // ptr[3] = 3; 29 | // ptr[4] = 4; 30 | 31 | // for (int i = 0; i < 5; i++) 32 | // { 33 | // printf("%d\n", ptr[i]); 34 | // } 35 | 36 | // REALLOC USING FOR REALLOCATE MEMORY ON A EXISTING POINTER, WE CAN INCREASE OR DECREASE THE MEMORY SIZE 37 | 38 | int *ptr; 39 | ptr = (int *)malloc(5 * sizeof(int)); 40 | ptr[0] = 0; 41 | ptr[1] = 1; 42 | ptr[2] = 2; 43 | ptr[3] = 3; 44 | ptr[4] = 4; 45 | 46 | for (int i = 0; i < 5; i++) 47 | { 48 | printf("%d\n", ptr[i]); 49 | } 50 | 51 | ptr = realloc(ptr, 2 * sizeof(int)); 52 | 53 | ptr[5] = 5; 54 | ptr[6] = 6; 55 | 56 | for (int i = 0; i < 7; i++) 57 | { 58 | printf("%d\n", ptr[i]); 59 | } 60 | 61 | // FREE FUNCTION USE FOR FREE THE MEMORY ALLOCATED DYNAMICALLY BY PROGRAMMER 62 | free(ptr); 63 | 64 | return 0; 65 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The C Programming Language 2 | 3 | Welcome to my C programming repository! This repository serves as a collection of projects, exercises, and resources related to the C programming language. Whether you're a beginner looking to learn C or an experienced programmer seeking to explore new concepts, you'll find something here to pique your interest. 4 | 5 | ## Table of Contents 6 | 7 | - [About](#about) 8 | - [Getting Started](#getting-started) 9 | - [Contributing](#contributing) 10 | - [Contact](#contact) 11 | 12 | ## About 13 | 14 | This repository is dedicated to showcasing my journey through the world of C programming. Here, you'll find a variety of projects, each designed to highlight different aspects of the language. I've used this repository as a canvas to practice, experiment, and learn. 15 | 16 | ## Getting Started 17 | 18 | If you're new to this repository or C programming in general, here's how you can get started: 19 | 20 | 1. Clone the repository to your local machine using `git clone https://github.com/subhankar18r/c_programming_language`. 21 | 22 | 2. Navigate to the project you're interested in within the repository. 23 | 24 | 3. Run, and explore the code. 25 | 26 | ## Contributing 27 | 28 | Contributions are welcome and encouraged! If you'd like to contribute to this repository: 29 | 30 | 1. Fork the repository to your GitHub account. 31 | 32 | 2. Create a new branch for your changes: `git checkout -b feature/new-feature`. 33 | 34 | 3. Make your changes and commit them with descriptive commit messages. 35 | 36 | 4. Push your changes to your forked repository. 37 | 38 | 5. Open a pull request describing your changes and their purpose. 39 | 40 | ## Contact 41 | 42 | Feel free to connect with me if you have any questions, suggestions, or just want to chat: 43 | 44 | - Email: [subhankar18r@gmail.com] 45 | - LinkedIn: [Subhankar Rajbanshi](https://www.linkedin.com/in/subhankar18r/) 46 | 47 | Thank you for visiting this repository and happy coding! 48 | --------------------------------------------------------------------------------