CSE 101
Programming in C
Start from zero and learn to think like a programmer in C: variables, decisions, loops, functions, arrays, strings, pointers, memory, structures and files.
0%complete
- Lessons
- 21
- Runnable examples
- 104
- Quiz questions
- 85
What you will be able to do
- Write, compile and run complete C programs
- Use
if,switchand loops to solve pattern and number problems - Break programs into functions and solve problems recursively
- Work with arrays, strings and 2D matrices
- Understand pointers, addresses and dynamic memory
- Model data with structures and save it to files
Syllabus
Unit 1Getting Started
- 1C IntroductionWhat C is, why it still runs the world, and your very first program — explained line by line.
- 2Syntax, Output & CommentsThe grammar rules of C, how
printfprints text and numbers, escape sequences, and how to comment code. - 3Variables, Data Types & ConstantsStore values in variables, choose the right data type, print them with the right format specifier, and lock values with constants.
- 4User Input with scanfRead numbers, characters and whole lines from the keyboard — and avoid the three classic scanf traps.
- 5Operators & ExpressionsArithmetic, increment, relational, logical, bitwise and ternary operators — plus precedence and type casting, which examiners love.
Unit 2Control Flow
- 6If, Else & SwitchMake decisions with
if,else if, nested conditions andswitch— with the classic grade, leap-year and calculator programs. - 7Loops: while, do-while and forRepeat work with the three C loops, choose the right one, and write the classic digit, factorial, prime and Fibonacci programs.
- 8Break, Continue & Pattern ProgramsControl loops with
break,continueandgoto, then master nested loops through the star and number patterns every exam asks for.
Unit 3Functions
- 9FunctionsSplit programs into named, reusable pieces: declarations, definitions, parameters, return values and call by value.
- 10RecursionFunctions that call themselves: base cases, the call stack, and the factorial, Fibonacci, power, digit-sum and Tower of Hanoi programs.
- 11Scope & Storage ClassesWhere variables live and how long they last: local, global and block scope, plus the auto, static, extern and register storage classes.
Unit 4Arrays & Strings
- 12ArraysStore many values of one type under one name: declaring, indexing, looping, and the sum, max, search and reverse programs.
- 132D Arrays & MatricesRows and columns: declaring 2D arrays, reading matrices, and the addition, transpose, multiplication and diagonal-sum programs.
- 14StringsCharacter arrays ending in '\0': reading strings, the string.h functions, and writing length, reverse, palindrome and vowel-count programs yourself.
Unit 5Pointers & Memory
- 15PointersAddresses, the & and * operators, pointer types, NULL, and pointer arithmetic — the idea that makes C powerful.
- 16Pointers, Arrays & FunctionsCall by reference, the swap function, returning several results, how arrays decay to pointers, and pointers to strings.
- 17Dynamic Memory AllocationAsk for memory at run time with malloc, calloc and realloc, give it back with free, and avoid leaks and dangling pointers.
Unit 6Structures, Files & More
- 18Structures, Unions & EnumsGroup related data with
struct, name types withtypedef, use arrays of structures and pointers to them, and compare structures with unions and enums. - 19File HandlingSave data that outlives your program: open, write, read, append and close text files with fopen, fprintf, fscanf, fgets and friends.
- 20Preprocessor, Macros & Command-Line ArgumentsWhat happens before compilation: #include, #define macros and their traps, conditional compilation, header guards, and reading arguments with argc/argv.
- 21C Cheat Sheet & Exam PrepEverything from CSE 101 on one page: syntax, format specifiers, operators, must-know programs and the mistakes that cost marks.