|
1 | 1 | # C-Programs
|
2 | 2 | This repository contains the programs in C illustrated during the sessions.
|
| 3 | + |
| 4 | +## Day 1: Structure of C program and Variables |
| 5 | +1. [Hello world](Day 1/hello.c) program which gets completely modified to understand range of values int can store. |
| 6 | +2. [Variable declaration](Day 1/variable.c) to understand how to declare variables. |
| 7 | +3. [Addition of two numbers](Day 1/add.c) to take two numbers as input and add them! |
| 8 | + |
| 9 | +## Day 2: Data types, I/O, Operators |
| 10 | +### Data Types |
| 11 | +1. int, char, float, double: [Basic Data Types](Day 2/inputOutput.c) |
| 12 | +2. Question on float type: [question1](Day 2/float.c) |
| 13 | +2. long and long long: [long](Day 2/long.c) |
| 14 | + |
| 15 | +### Input and Output |
| 16 | +1. [scanf](Day 2/scanf.c) |
| 17 | +2. [printf](Day 2/printf.c) |
| 18 | + |
| 19 | +### Operators |
| 20 | +#### Binary Operators |
| 21 | +1. [Arithmetic Operators](Day 2/arithmeticOperators.c) |
| 22 | +2. [Assignment Operators](Day 2/assignmentOperator.c) |
| 23 | +3. [Logical Operators](Day 2/logicalOperators.c) |
| 24 | +#### [Unary Operators](Day 2/unaryOperator.c) |
| 25 | + |
| 26 | +## Day 3: Conditional statements |
| 27 | +### [Logical Operators](Day 3/logicalOperators.c) |
| 28 | + |
| 29 | +### If conditional statement |
| 30 | +Simple program using if: [if](Day 3/if.c) |
| 31 | + |
| 32 | +### If Else conditional statement |
| 33 | +1. Simple program using if...else: [ifElse](Day 3/ifElse.c) |
| 34 | +2. Question on finding output of if...else: [question](Day 3/question.c) |
| 35 | + |
| 36 | +## Day 4: More on conditionals |
| 37 | +### If Else If ladder |
| 38 | +[Program to print grade given marks](Day 4/ifElseIf.c) |
| 39 | + |
| 40 | +### Nested If Else |
| 41 | +1. [Motivation](Day 4/nestedIfElseMotivation.c) |
| 42 | +2. [Improved version of program above](Day 4/nestedIfElse.c) |
| 43 | + |
| 44 | +### Switch Case statement |
| 45 | +[Program to print day of week given day number](Day 4/switch.c) |
| 46 | + |
| 47 | +### Side Learnings |
| 48 | +1. [ASCII values for character](Day 4/asciiValues.c) |
| 49 | +2. [Bitwise Operators](Day 4/bitwiseOperators.c) |
| 50 | + |
| 51 | +## Day 5: Getting started with Loops |
| 52 | +1. [Why do we need loops?](Day 5/loopMotivation.c) |
| 53 | +2. [For loop](Day 5/forLoop.c) |
| 54 | +3. [Exercise based on for loop](Day 5/exerciseForLoop.c) |
| 55 | + |
| 56 | +## Day 6: More on Loops |
| 57 | +1. [Factorial of n using while loop](Day 6/whileLoop.c) |
| 58 | +2. [Find sum of digits of a number](Day 6/sumDigits.c) |
| 59 | +3. [do...while loop](Day 6/doWhile.c) |
| 60 | +4. [Infinite loops](Day 6/infiniteLoop.c) |
| 61 | + |
| 62 | +### Nested loops |
| 63 | +1. [Multiplication table using nested loops](Day 6/nestedLoops.c) |
| 64 | + |
| 65 | +## Day 7: Jump statements |
| 66 | +### Break, continue and goto |
| 67 | +1. [Example program to understand break](Day 7/break.c) |
| 68 | +2. [Example program to understand continue](Day 7/continue.c) |
| 69 | +3. [Example program to understand goto](Day 7/goto.c) |
| 70 | + |
| 71 | +### Usage of break |
| 72 | +1. [Check whether given number is prime](Day 7/prime.c) |
| 73 | + |
| 74 | +### Creating your own functions |
| 75 | +1. [Sum of first n prime numbers](Day 7/sumOfNPrimes.c) |
| 76 | + |
| 77 | +## Day 8: Introduction to Pointers |
| 78 | +1. [Nested Loop: Pattern printing](Day 8/nestedLoopPattern.c) |
| 79 | +2. [Two functions to swap numbers](Day 8/swap.c) |
| 80 | + |
| 81 | + The first function doesn't work. We try to understand why that doesn't work. |
| 82 | + An introduction to pointers and memory is provided. |
| 83 | + Referencing and Dereferencing operators are discussed. |
| 84 | + |
| 85 | +## Day 9: Introduction to Arrays |
| 86 | +1. [Understanding object and value contexts](Day 9/pointers1.c) |
| 87 | +2. [Introduction to arrays](Day 9/arrays.c) |
| 88 | +3. [Array Initialization](Day 9/arrayInitialization.c) |
| 89 | +4. [Character Array](Day 9/charArray.c) |
| 90 | + |
| 91 | +## Day 10: Pointer arithmetic and Array examples |
| 92 | +1. [Character array vs String in C](Day 10/charArrayVsString.c) |
| 93 | +2. [Understanding various declarations](Day 10/allDeclarations.c) |
| 94 | +3. [Pointer arithmetic](Day 10/pointerArithmetic.c) |
| 95 | +4. [Array value rule](Day 10/arrayValueRule.c) |
| 96 | +5. [Count no. of words in a line](Day 10/countWordsInLine.c) |
| 97 | + |
| 98 | +## Day 11: Functions in C |
| 99 | +1. [Call by value](Day 11/callByValue.c) |
| 100 | +2. [Simulated Call by reference](Day 11/callByReferenceSimulated.c) |
| 101 | +3. [Fibonacci Function](Day 11/fibonacciFunction.c) |
| 102 | +4. [Max of three numbers function](Day 11/maxOfThreeNumbers.c) |
| 103 | +5. [Recursive functions](Day 11/recursiveFunction.c) |
| 104 | + |
| 105 | +## Day 13: Passing arrays to functions and 2D arrays introduction |
| 106 | +1. [Passing arrays to functions](Day 13/sumOfArray.c) |
| 107 | +2. [Reference variables in C++](Day 13/referenceVariables.cpp) |
| 108 | +3. [Introduction to 2D arrays](Day 13/printMatrix.c) |
| 109 | + |
| 110 | +## Day 14: Array of arrays, Typecasting, Macros, Static variables |
| 111 | +1. [Understand array of arrays](Day 14/arrayOfArrays.c) |
| 112 | +2. [Implicit Typecasting](Day 14/typecasting.c) |
| 113 | +3. [Explicity Typecasting](Day 14/avgOfThreeNumbers.c) |
| 114 | +4. [Constants in C][Day 14/constant.c] |
| 115 | +5. [Macros](Day 14/macros.c) |
| 116 | +6. [Static variables](Day 14/staticVariable.c) |
| 117 | + |
| 118 | +## Day 15: Structures in C |
| 119 | +1. [Declaring and using structure](Day 15/structFish.c) |
| 120 | +2. [Nested structures](Day 15/nestedStructures.c) |
| 121 | +3. [Updating structure fields](Day 15/turtleBirthday.c) |
0 commit comments