
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
This step-by-step C programming course for beginners, led by Sharif, guides you through course contents and installation basics, with practice programs, programming challenges, online coding challenges, and GitHub resources.
Install code blocks by downloading the binary release or source code, set up MinGW GCC, and create a console application project in Code Blocks.
Create your first C program in code blocks, using stdio.h and printf in the main function, and run it with ctrl+f9 and ctrl+f10.
Solve your first C programming challenge by printing hello world and a given string, learning input/output, and completing a simple function to sum two integers.
Discover what computer programming is, why we need it, and how writing programs instructs computers in binary to solve tasks. Develop analytical thinking and problem solving skills.
Define a program as a sequence of instructions a computer executes, and explain the programmer's role and programming languages including C, C++, Java, and Python.
Explore the three levels of programming languages: low level, middle level, and high level. Understand machine and assembly languages and how assemblers, compilers, and interpreters translate code.
Discover structured programming and its advantages in C language, including clearer code, modular functions, easier maintenance, reduced complexity, fewer logical errors, and simpler debugging.
Explore the stages of C program development and execution, from editing with the preprocessor to compiling, linking, loading into memory, and running to produce output.
Highlight how C is a middle level, general purpose language offering system and application software flexibility, with direct access to machine level APIs, case-sensitive syntax, portability, and function-based structured programming.
Explore assemblers, compilers and interpreters, how source code becomes object code, and the difference between whole-program and line-by-line translation with examples in C, C++, and Java.
Discover what a bug is, differentiate syntax, runtime, and logical errors, and learn debugging with gdb to locate and fix defects in C programs.
trace the brief history of C from Dennis Ritchie's 1972 development in the United States, through its B language predecessor, to the 1990 ansi/iso standard and beyond to C18.
Explore keywords and identifiers in C language, learn how to name identifiers, follow rules for starting characters and allowed symbols, and distinguish valid from invalid names.
Explore keywords and identifiers in C with practical examples, showing valid identifiers, reserved keywords you cannot use, and rules about starting with digits or identifiers up to 31 characters.
Discover comments in C, learning what comments are and the two types: single-line and multi-line. See how well-documented, indented code improves readability and debugging.
Learn how to use single-line and multi-line comments in C, see how the compiler ignores them, and write readable code by describing variables and logic.
Discover how to declare and name variables according to the rules, understand literals, including integers, floating point, characters, and strings, and create constants with const or has defined in C.
Explore the data types in C, including signed and unsigned integers, characters, pointers, structures, unions, enums, and typedef; learn how memory space and qualifiers like short and long shape variables.
Learn the primary data types in C, including int, float, double, char and void, and understand how memory space and value ranges are determined, including signed versus unsigned representations.
Explore primary data types in C, using the size of operator to measure memory usage across int, short, long, long long, signed and unsigned on a 64-bit compiler.
Tackle coding challenge #2 by reading two integers and two floats, then compute their sum and difference, and print the results with exactly one decimal place.
Master expressions and operator precedence in programming; convert math formulas to code and evaluate expressions left to right with triangle area and rectangle perimeter examples.
Explore basic input and output functions in C, including printf and scanf, with examples reading characters and integers and displaying their ASCII values.
Explore the benefits and importance of operators in C, including code simplification, readability, arithmetic and data manipulation, memory management, complex expressions, and practical examples like bubble sort and linked lists.
Define an operator and classify C operators into unity, binary, and ternary, listing examples such as plus, minus, multiplication, division, percentile, relational, logical, assignment, increment, decrement, and the conditional operator.
Explore arithmetic operators in C, including addition, subtraction, multiplication, division, and modulo, with variable-based examples and the assignment operator showing how results update.
See a practical demo of arithmetic operators in C using three variables A, B, and C. Learn how addition, subtraction, multiplication, division, and remainder operate and update values.
Explore how increment and decrement operators work in C, including pre and post variants, and compare their effects in expressions.
Demonstrate pre and post increment and decrement operators in C, showing how values update in memory and in expressions or assignments.
Learn how assignment operators in C assign values to variables, from the common = to shortcuts like +=, -=, *=, /=, %=, and how they pair with arithmetic operations.
Master relational operators in C, including equals and not equals, and learn how they drive decisions in if statements and loops. Avoid confusing assignment with equality to prevent logical errors.
Explore how logical operators in C evaluate expressions to true or false, returning 1 or 0, including and, or, and not, and used in decision making and loops.
Learn how the sizeof operator in the C language determines the memory size of variables, types, and structures, enabling dynamic memory allocation and portability across platforms.
Explore bitwise operators in C, enabling bit level operations that speed up processing and access hardware, including &, |, ^, ~, <<, and >>.
Learn bitwise operators in C, including and, or, xor, not, and shift left and right, with binary examples using 4 and 5.
Explores bitwise operators in C, including and, or, and xor, through a hacker rank style challenge to maximize a, b, and a xor b under a key.
Master the ternary operator in C, a three-part conditional that uses ? and : to select between expressions. See its syntax, truth evaluation, and nesting with examples like max = (a > b) ? a : b.
Learn how to find the largest of three numbers in C using the ternary operator, with step-by-step examples and nested condition logic.
Explore operator precedence and associativity in the C language, showing how evaluation order is decided with examples like plus and multiply, and how parentheses and same priority operators affect results.
Explore flow control in C programming, from sequential execution in main to conditional statements, loops, and switch-based decisions, including if, else if ladders, for, while, and do while.
Explore decision control statements in C, including simple if, if-else, nested if, and if-else ladder, and learn how conditions determine true or false to guide program flow.
Demonstrate a simple if condition in C by reading an integer and printing different messages based on whether the number is negative or not.
Explore the else-if condition in C through a practice program on conditional statements, using the modulo operator to test even and odd numbers and observe block usage rules.
Explore nested if statements in C by reading two integers and using relational operators to determine if the first is greater, equal, or less than the second.
Practice the if-else ladder in C with a step-by-step program that compares two numbers for equality, greater than, and less than. Learn decision control statements and their execution flow.
Explore conditional statements in C using if and else ladders to map numbers 1–9 to their lowercase English words. Print 'greater than 9' for any other inputs.
Learn how switch case statements control program flow in the C language by evaluating an expression, matching cases, and executing the corresponding block with break or default when no match.
Solve the largest of three numbers with if-else by comparing a, b, and c using logical and, then output the result with printf.
Determine the determinant of the quadratic equation using B^2 minus four A C, then compute real roots for determinant zero or greater using the quadratic formula.
Find the roots of a quadratic equation by computing the determinant (b^2-4ac), classify as real and unequal, real and equal, or imaginary, and compute roots using the quadratic formula.
Explore a programming challenge to calculate electricity bill charges from kilowatt hour usage using a slab based tariff structure, with rates for 0–200, 201–400, 401–600, and above 600 units.
Solve a programming challenge in C by calculating electricity bill charges using a tiered tariff based on units, with input validation and range-based calculations.
Explore the concept of loops in C programming, covering for, while, and do-while loops, with emphasis on iterations, nested loops, and practical use to repeat tasks efficiently.
Understand how the while loop in C evaluates a test expression, repeats the body while true, and stops when false, using while (condition) { statements } with initialization and braces.
Practice program using a while loop in C language to compute the factorial of a given number, illustrating initialization, loop control, and iterative multiplication to print the result.
Explore the for loop in C language by examining initialization, condition checking, and updating expressions, and follow its flow from start to termination with a practical i example.
Practice program demonstrates accessing and printing ascii values for lowercase and uppercase letters in C language using for loops and the 32 difference between cases.
Practice implementing factorial in C using a for loop that multiplies a running total by i, with initialization and the comma operator, and compare it to a while loop.
Practice for loop in C by iterating from a to b, printing English words for 1-9 and 'even' or 'odd' for numbers above nine.
Explore the do-while loop in C language and its differences from the while loop. Observe the test at the end, ensuring the block executes at least once, with a semicolon.
Explore do-while loops in C through a menu-driven program that performs subtraction and multiplication, using switch-case and break to control flow, while ensuring the loop runs at least once.
Understand break and continue statements in C language to control loops: break ends a loop immediately, while continue skips the current iteration, across while, for, and do-while.
Explains nested loops in C, showing how for loops can enclose other loops of any type, with a prime-number example using nested loops, break and continue to control flow.
Learn to print a multiplication table for a given number in the exact format, and extend to print tables up to N.
Demonstrates how to print a multiplication table in C using a for loop, read user input, and print multiple tables from 2 to the input number with nested loops.
Learn to reverse a given number by reading input, extracting the last digit, and building the reversed value by multiplying by 10 and adding digits until zero.
Learn to reverse a number in C using a loop, extract the last digit with division by 10 and remainder, and print the reversed result with printf.
Discover how to determine palindromic numbers in C by reversing a number and comparing it to the original using a temporary variable, with examples like 343 and 456.
Explore how to determine if a number is a palindrome by reversing digits and comparing with the original using the modulo operator, division, and a while loop.
Learn to print a Pascal triangle with asterisks in six lines using nested loops, printing spaces and asterisks in each row to shape the triangle.
learn to input a five digit number and compute the sum of its digits using modulo 10 and division by 10, iterating until the number becomes zero.
Learn to print a number pattern in C using nested loops, based on input n, producing a 1 to n pattern with length two times n minus one.
Explore goto and labels in C language, including unconditional jumps, label definitions, and how goto alters program flow, along with drawbacks and alternatives such as break and continue.
Introduces the concept of functions in C, showing how structured programming uses blocks to improve readability and maintainability. Describes predefined and user defined functions, library headers, prototypes, and include directives.
Explore how user defined functions in C are defined, declared, and called, including function prototypes, parameter passing by value or by reference, and swapping examples.
Practice by value parameter passing in C with a swap example using a temporary variable. See how changes to formal parameters do not affect actual parameters.
Explore C storage classes auto, static, register, and extern, and how scope, lifetime, and location affect variable visibility. Learn memory layout including text, data, BSS, heap, and stack.
Explore recursive functions in C, their base conditions, and how stack memory and tracing illustrate factorial and sum examples to prevent stack overflow.
Demonstrate recursive functions in C by summing natural numbers in a program where main calls sum, using a base condition, and observe outputs like 6 and 15.
Explore how variadic functions in C manage variable arguments with macros like va_list, va_start, va_arg, va_end, and va_copy, with printf and scanner examples and mandatory versus optional arguments and ellipses.
Explore variadic macros in C, including va_list, va_start, va_end, va_arg, and va_copy, to handle optional parameters, and examine a practice program that averages a variable number of inputs.
Learn to compute the gcd of two numbers using subtraction and recursion, with step-by-step guidance and examples showing how to handle equal inputs and cases with no common factors.
Explore finding the greatest common divisor of two numbers using both iterative and recursive approaches, with a template program, examples, and practical implementation details in C.
Learn how to generate the fibonacci series by adding the previous two numbers, with examples for n=5 and n=8, and compare iterative and recursive approaches.
Explore a recursive fibonacci function in C, with base cases n=1 and n=2 and fib(n-1) + fib(n-2), plus a user input loop to continue with new numbers.
Learn to implement a max function in C to find the greatest of four integers using a two-parameter max and a ternary operator, with input and output handling.
Explore recursion by computing the nth term of a tribonacci-like series with three initial terms abc. Define base conditions to avoid infinite recursion and present the three recursive calls.
Learn to implement variadic functions in C that take a variable number of arguments, using va_list, va_start, and va_end to compute sums, minima, and maxima.
Explore arrays in C: a contiguous, zero-based collection of elements of the same type, accessed by index for fast access, including basic and derived types such as structures and unions.
declare and initialize one-dimensional arrays in C, access elements with zero-based indices, and read and display values using for loops under static memory allocation.
Shows bubble sort on a one-dimensional array in C, swapping adjacent elements to sort numbers in ascending order with an O(n^2) time complexity.
Sort an array in ascending order using selection sort by repeatedly selecting the smallest element, swapping it into place, and noting the quadratic time complexity.
Explains how to sort an array in ascending order using selection sort, selecting the smallest element and swapping. Also shows how to adapt to descending order.
Implement a linear search in C to locate a key element in an array, stop at first match, and distinguish between successful and unsuccessful searches.
Learn the basics of linear search in an array by locating a key element with a loop, breaking on a match, and handling not-found cases with a flag.
Learn how binary search finds a key in a sorted array by comparing with the middle element, updating low and high bounds, and handling found and not found cases.
Learn to reverse an array in C using a two-pointer in-place technique with a temporary variable, swapping left and right elements until the pointers meet.
Explore multi-dimensional arrays in C language, from two to four dimensions, learn how to calculate total elements and compare row major versus column major storage.
Understand two dimensional arrays in C as a table of rows and columns, accessed with x[i][j], initialized by dimensions or values, and handled with for loops for input and output.
Practice program demonstrates reading a two-dimensional array (matrix) of user-specified rows and columns, summing all elements with nested loops, and displaying the total.
Learn matrix addition using two dimensional arrays by reading two 2x2 matrices a and b and displaying their sum c with nested for loops.
This practice session demonstrates two-dimensional matrix multiplication with 2-D arrays, checks that the first matrix columns match the second's rows, performs multiply-and-add, and displays the resulting matrix.
Explore how a three dimensional array in C is stored and mapped into memory, and implement it with a practice program using three for loops.
Explore a dynamic array in C through a library shelf challenge with three types of queries: insert books, print pages of a specific book, and count books per shelf.
Explore pointers in C by declaring pointer variables, understanding how they store addresses, and access values via the address and dereference operations, with examples of ampersand and the * operator.
Explore pointers in c by creating a program that prints a variable's value and its address, using ampersand and dereference operations.
Explore how arrays and pointers relate in C, understand base addresses, and practice accessing elements with pointer arithmetic and dereferencing.
Learn to compute the sum of alternate marks based on gender in a hacker rank coding challenge: boys sum even indices, girls sum odd indices.
Explore pointer arithmetic in C by using base addresses, arrays, and pointer increments, decrements, and arithmetic on pointers to access array elements and their memory addresses.
Explore the pointer to a pointer in C, a double pointer that holds the address of another pointer and enables two levels of indirection.
Explore pointers and functions in C, contrasting call by value and call by reference, and implement swap using pointers to reflect changes in actual parameters.
Explore call-by-reference parameter passing in C using pointers to swap values by passing addresses. See how the swap updates main's variables through pointers.
Explore C pointers, including generic white pointers, null pointers, and near, far, and huge pointers, with explanations of memory addresses, typecasting for dynamic allocation, and segment access.
Learn dynamic memory allocation in C by using malloc, calloc, and realloc to allocate and resize memory at runtime on the heap, then free to release it.
Learn dynamic memory allocation with malloc to allocate memory at runtime, cast the returned address to an integer pointer, use size of to determine allocation size, and check for failure.
Learn dynamic memory allocation in C by creating a heap allocated one dimensional array with malloc, reading n elements, summing them, and printing the result, then freeing memory.
Master pointers in C by implementing the update function that takes two integer pointers, updates the first with the sum and the second with the absolute difference using abs.
Explore how strings in C are arrays of characters with a null terminator, and how to declare, initialize, and read or write them using scanf, printf, and gets or fgets.
Explore string functions in C for concatenation, copying, and length, and for comparing strings, including versions that copy or concatenate with a limit of n characters, with syntax and examples.
Learn to use built-in string functions in C, such as strcmp, strcat, strlen, and strcpy, through a demonstration program that reads two strings, compares, concatenates, measures length, and copies.
Demonstrates string operations in C without using string functions, including comparing two strings, concatenating them, computing their length, and copying contents from one string to another.
Learn to convert string cases with pointers by traversing characters to the null terminator, using ASCII ranges 65 to 90 and 97 to 122 and a 32 difference.
Learn to read a character, a word, and a sentence in C, handle input with scanf and newlines, define max lengths, and print each on its own line.
Print each word of a sentence on a new line by splitting on spaces. Highlight dynamic memory usage with malloc, reallocate, and free to manage the string and tokens.
Tackle a hacker rank digit frequency challenge by scanning a mixed alphanumeric string and counting the occurrences of digits 0-9, then output the frequencies space-separated.
This lecture introduces a generic string sorting approach in C, using a comparator function pointer and four comparators—lexicographic, reverse, distinct characters, and by length—to sort arrays of strings.
Explore generating unique permutations of strings in strict lexicographic order using the next permutation approach, handling duplicates, and printing each permutation as a sequence of strings.
Explore parsing a document into paragraphs, sentences, and words using pointers in C, with functions get_document, get_paragraph, get_sentence, and get_word, plus sample queries.
Learning C programming will not only make you learn one of the most powerful Programming Languages of all time, but also gives a strong base for developing Problem solving Skills in the field of computer science and Engineering.
Learning C Language helps you make you a better programmer for other Programming Languages like C++, Java, Python, C# etc. by knowing what the computer is actually doing when you run your programs.
Your instructor, Sharief has been teaching students for over 24 years to University graduates and under-graduates. He runs different curriculum including Internet technologies, Object-Oriented programming and of course C programming language.
This means that you are learning from someone who has all the professional training, skills, and experience needed to teach you how to become proficient in the C programming language.
Who should take the course
· Beginners – if you've never coded before, you can learn here C Language step by step.
· Programmers switching to C from some other language such as Java, Ruby or Python
· Cross-platform developers – there are C compilers for all major operating systems
· Anyone who needs to program C++ or Objective-C. The C language is the best one to start with.
Who this course is for:
· Newcomers to programming.
· Programmers of other languages who want a fast way into C
· Anyone who needs to master C as a basis for using C++ or Objective-C