Learn today. Build your future with AIFA Infotech. Need help? Contact Us
๐Ÿ’ป AIFA INFOTECH ยท PROGRAMMING TRACK

Learn C.
Build Logic.

Start with your first program and progress to arrays, functions, pointers, memory management and practical projects. Open each chapter for its topics, example code and practice task.

22Chapters
3Learning levels
6+Project ideas
int main(void)Arrays ยท Pointersprintf("Hello!")Compile โœ“
C
Why learn with AIFA?

A clear path from basics to projects

Learn concepts in sequence, read example code, and practise after each chapter.

๐Ÿงฉ

Build programming logic

Practise conditions, loops, patterns and problem-solving with small exercises.

๐Ÿ–ฅ๏ธ

Understand memory

Study arrays, pointers, structures and dynamic memory with examples.

๐Ÿ› ๏ธ

Apply what you learn

Use chapter tasks to prepare for console applications and portfolio projects.

Course syllabus

All C Programming Chapters

Open a chapter to view the syllabus, example code and practice task. Search topics and mark chapters complete to track progress during this visit.

0 chapters completed0%
01Introduction to C ProgrammingUnderstand C, its features, applications and program structure.Beginner30 minโŒ„

What you will learn

  • What is C?
  • History and features
  • Applications of C
  • Compiler, IDE and source files
  • Compile and run a program
Example code ยท C
#include <stdio.h>
int main(void) {
    printf("Hello, AIFA!\n");
    return 0;
}
โœ๏ธ PRACTICE TASK

Print your name, course and city on separate lines.

02Setting Up C CompilerSet up a C development environment and run a program.Beginner25 minโŒ„

What you will learn

  • GCC overview
  • Code editor and IDE
  • Source and executable files
  • Compile from terminal
  • Common compiler errors
Example code ยท C
gcc main.c -o main
./main
โœ๏ธ PRACTICE TASK

Create main.c, compile it and run the executable.

03Structure of a C ProgramLearn header files, main(), statements, braces and comments.Beginner35 minโŒ„

What you will learn

  • Preprocessor directives
  • The #include directive
  • main() function
  • Statements and semicolons
  • Single-line and multi-line comments
Example code ยท C
#include <stdio.h>
int main(void) {
    // Display a message
    printf("Learning C!\n");
    return 0;
}
โœ๏ธ PRACTICE TASK

Add comments and print two different messages.

04Variables, Constants and Data TypesStore information and choose suitable data types.Beginner45 minโŒ„

What you will learn

  • Variable declaration and initialization
  • int, char, float and double
  • Constants with const
  • Identifiers and naming rules
  • Basic type conversion
Example code ยท C
#include <stdio.h>
int main(void) {
    int age = 20;
    float marks = 86.5f;
    char grade = 'A';
    printf("%d %.1f %c\n", age, marks, grade);
    return 0;
}
โœ๏ธ PRACTICE TASK

Create variables for roll number, percentage and grade.

05Input and OutputDisplay output with printf() and read input with scanf().Beginner40 minโŒ„

What you will learn

  • printf() formatting
  • scanf() basics
  • Format specifiers %d, %f, %c, %s
  • Escape sequences
  • Input validation
Example code ยท C
#include <stdio.h>
int main(void) {
    int age;
    printf("Enter age: ");
    if (scanf("%d", &age) == 1)
        printf("Age: %d\n", age);
    return 0;
}
โœ๏ธ PRACTICE TASK

Ask the user for two numbers and display them.

06Operators and ExpressionsPerform calculations and compare or combine values.Beginner45 minโŒ„

What you will learn

  • Arithmetic operators
  • Relational operators
  • Logical operators
  • Assignment and increment/decrement
  • Operator precedence
Example code ยท C
#include <stdio.h>
int main(void) {
    int a = 12, b = 5;
    printf("Sum = %d\n", a + b);
    printf("Remainder = %d\n", a % b);
    return 0;
}
โœ๏ธ PRACTICE TASK

Build a two-number calculator.

07Decision Making: if, else and switchMake programs choose actions based on conditions.Beginner50 minโŒ„

What you will learn

  • if statement
  • if-else and else-if ladder
  • Nested conditions
  • switch-case and break
  • if versus switch
Example code ยท C
#include <stdio.h>
int main(void) {
    int marks = 78;
    if (marks >= 80) printf("Grade A\n");
    else if (marks >= 60) printf("Grade B\n");
    else printf("Keep practising\n");
    return 0;
}
โœ๏ธ PRACTICE TASK

Check whether a number is positive, negative or zero.

08Loops: for, while and do-whileRepeat instructions and control loop execution.Beginner55 minโŒ„

What you will learn

  • for loop
  • while loop
  • do-while loop
  • break and continue
  • Nested loops and infinite-loop prevention
Example code ยท C
#include <stdio.h>
int main(void) {
    for (int i = 1; i <= 5; i++) printf("%d ", i);
    printf("\n");
    return 0;
}
โœ๏ธ PRACTICE TASK

Print the multiplication table of a number.

09Patterns and Number ProgramsImprove logic with nested loops and number problems.Beginner60 minโŒ„

What you will learn

  • Star and number patterns
  • Sum of natural numbers
  • Factorial
  • Prime number check
  • Reverse and palindrome number
Example code ยท C
#include <stdio.h>
int main(void) {
    for (int r = 1; r <= 4; r++) {
        for (int c = 1; c <= r; c++) printf("* ");
        printf("\n");
    }
    return 0;
}
โœ๏ธ PRACTICE TASK

Create a triangle pattern and reverse an integer.

10One-Dimensional ArraysStore and process multiple values of the same type.Intermediate50 minโŒ„

What you will learn

  • Array declaration and initialization
  • Indexing starts at zero
  • Traversing with loops
  • Sum, average, maximum and minimum
  • Array boundary mistakes
Example code ยท C
#include <stdio.h>
int main(void) {
    int marks[] = {72, 85, 91, 68}, total = 0;
    for (int i = 0; i < 4; i++) total += marks[i];
    printf("Total = %d\n", total);
    return 0;
}
โœ๏ธ PRACTICE TASK

Read five numbers into an array and find their average.

11Multidimensional ArraysRepresent tables and matrices using 2D arrays.Intermediate45 minโŒ„

What you will learn

  • Two-dimensional array declaration
  • Nested-loop traversal
  • Matrix input and output
  • Matrix addition
  • Matrix transpose
Example code ยท C
#include <stdio.h>
int main(void) {
    int m[2][2] = {{1, 2}, {3, 4}};
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 2; j++) printf("%d ", m[i][j]);
        printf("\n");
    }
    return 0;
}
โœ๏ธ PRACTICE TASK

Add two 2ร—2 matrices.

12Strings and Character HandlingWork with character arrays and string functions.Intermediate55 minโŒ„

What you will learn

  • Strings as character arrays
  • Null terminator
  • Reading strings safely
  • strlen(), strcmp(), strcpy(), strcat()
  • Character functions in ctype.h
Example code ยท C
#include <stdio.h>
#include <string.h>
int main(void) {
    char name[] = "AIFA";
    printf("Text: %s\nLength: %zu\n", name, strlen(name));
    return 0;
}
โœ๏ธ PRACTICE TASK

Count characters in a word and compare two words.

13Functions and Modular ProgrammingBreak a program into reusable functions.Intermediate55 minโŒ„

What you will learn

  • Function declaration and definition
  • Parameters and return values
  • Function prototypes
  • Call by value
  • Scope and lifetime of variables
Example code ยท C
#include <stdio.h>
int add(int a, int b) { return a + b; }
int main(void) {
    printf("Sum = %d\n", add(10, 20));
    return 0;
}
โœ๏ธ PRACTICE TASK

Create functions to find the square and maximum of two numbers.

14RecursionUnderstand functions that call themselves.Intermediate40 minโŒ„

What you will learn

  • Recursive function structure
  • Base and recursive cases
  • Factorial using recursion
  • Recursive sum
  • Recursion versus iteration
Example code ยท C
#include <stdio.h>
int factorial(int n) {
    if (n <= 1) return 1;
    return n * factorial(n - 1);
}
int main(void) { printf("%d\n", factorial(5)); return 0; }
โœ๏ธ PRACTICE TASK

Write a recursive function to sum integers from 1 to n.

15Pointers and Memory AddressesUnderstand addresses, pointer variables and dereferencing.Intermediate60 minโŒ„

What you will learn

  • Address-of operator &
  • Pointer declaration and initialization
  • Dereferencing with *
  • NULL pointers
  • Pointers as function parameters
Example code ยท C
#include <stdio.h>
int main(void) {
    int value = 50;
    int *ptr = &value;
    printf("Value = %d\n", *ptr);
    printf("Address = %p\n", (void *)ptr);
    return 0;
}
โœ๏ธ PRACTICE TASK

Use a pointer to read and update a variable.

16Pointers and ArraysExplore arrays, pointers and pointer arithmetic.Intermediate45 minโŒ„

What you will learn

  • Array name and first element address
  • Pointer arithmetic
  • Traversing arrays with pointers
  • Passing arrays to functions
  • Bounds and memory safety
Example code ยท C
#include <stdio.h>
int main(void) {
    int nums[] = {10, 20, 30};
    int *ptr = nums;
    for (int i = 0; i < 3; i++) printf("%d ", *(ptr + i));
    return 0;
}
โœ๏ธ PRACTICE TASK

Display array elements using a pointer.

17Structures, Unions, enum and typedefGroup related data and define named constants.Intermediate50 minโŒ„

What you will learn

  • Defining and using struct
  • Accessing members with dot
  • Pointer to structure and arrow operator
  • Union memory sharing
  • enum and typedef
Example code ยท C
#include <stdio.h>
struct Student { int roll; char grade; };
int main(void) {
    struct Student s = {101, 'A'};
    printf("%d %c\n", s.roll, s.grade);
    return 0;
}
โœ๏ธ PRACTICE TASK

Create a Student structure with roll, marks and grade.

18Storage Classes and PreprocessorLearn variable storage and preprocessing directives.Advanced45 minโŒ„

What you will learn

  • Local and global variables
  • static and auto
  • extern and register concepts
  • Macros with #define
  • Conditional compilation and header guards
Example code ยท C
#include <stdio.h>
#define MAX_SCORE 100
int main(void) {
    static int visits = 0;
    visits++;
    printf("Visit %d of %d\n", visits, MAX_SCORE);
    return 0;
}
โœ๏ธ PRACTICE TASK

Create a function with a static counter.

19File HandlingRead and write files while checking errors.Advanced60 minโŒ„

What you will learn

  • FILE pointer and fopen()
  • File modes
  • fprintf(), fscanf(), fgets(), fputs()
  • fclose() and error checks
  • Binary file basics
Example code ยท C
#include <stdio.h>
int main(void) {
    FILE *f = fopen("notes.txt", "w");
    if (f == NULL) { perror("Open failed"); return 1; }
    fputs("C file handling practice\n", f);
    fclose(f);
    return 0;
}
โœ๏ธ PRACTICE TASK

Save three student names to a file and read them back.

20Dynamic Memory AllocationAllocate and release memory at runtime.Advanced55 minโŒ„

What you will learn

  • Stack and heap concepts
  • malloc() and calloc()
  • realloc()
  • free()
  • Allocation failure and dangling pointers
Example code ยท C
#include <stdio.h>
#include <stdlib.h>
int main(void) {
    int *n = malloc(3 * sizeof *n);
    if (n == NULL) return 1;
    n[0] = 10; n[1] = 20; n[2] = 30;
    printf("%d\n", n[1]);
    free(n); n = NULL;
    return 0;
}
โœ๏ธ PRACTICE TASK

Allocate an integer array dynamically and free it safely.

21Command-Line Arguments and DebuggingAccept command-line input and debug systematically.Advanced40 minโŒ„

What you will learn

  • argc and argv
  • Checking argument count
  • Compiler warnings
  • Reading error messages
  • Testing edge cases and using a debugger
Example code ยท C
#include <stdio.h>
int main(int argc, char *argv[]) {
    printf("Arguments: %d\n", argc - 1);
    if (argc > 1) printf("First: %s\n", argv[1]);
    return 0;
}
โœ๏ธ PRACTICE TASK

Accept a name as a command-line argument and greet the user.

22Final Projects and PracticeCombine C concepts into complete console applications.ProjectsSelf-pacedโŒ„

What you will learn

  • Calculator
  • Student record system
  • Quiz application
  • Library management system
  • Banking menu with file storage
  • Testing and project presentation
Example code ยท C
#include <stdio.h>
int main(void) {
    int choice;
    do {
        printf("\n1. Add record\n2. View records\n0. Exit\nChoice: ");
        if (scanf("%d", &choice) != 1) return 1;
        /* Add each menu action in a separate function. */
    } while (choice != 0);
    return 0;
}
โœ๏ธ PRACTICE TASK

Choose a project, plan its functions, validate input and test edge cases.

Practical learning

Projects to build your confidence

Combine concepts from several chapters to create complete console-based applications.

PROJECT 01

Calculator

Use operators, functions and switch statements to build a menu-based calculator.

PROJECT 02

Student Record System

Use structures, arrays and file handling to save and display student records.

PROJECT 03

Quiz Application

Use conditions, loops and score tracking to create a multiple-choice quiz.

PROJECT 04

Library Management

Practise records, search operations and persistent storage for book details.

PROJECT 05

Banking Menu

Model deposits, withdrawals and balance checks with input validation.

PROJECT 06

Number Utility

Combine functions and loops for factorials, prime checks and number operations.

Ready to start learning C?

Follow the chapters in order, practise every task and gradually build your own C programming projects with AIFA Infotech.