Start your programming journey with one of the most powerful and foundational languages — C. This comprehensive course is designed for absolute beginners as well as intermediate learners who want to build a solid understanding of programming using the C language. Whether you're preparing for college-level programming, cracking technical interviews, or planning to explore systems or embedded development, this course covers everything step-by-step. Through hands-on examples, real-world practice problems, and structured explanations, you’ll learn how to write clean and efficient C code — from your first printf() to advanced data structures and memory management.
In C, functions provide modularity and reusability. Complex data such as arrays, structures, and pointers can be passed to functions to process them efficiently. This is crucial for writing clean and scalable programs.
Arrays are always passed by reference (i.e., the base address is passed).
void printArray(int arr[], int size) {
for(int i = 0; i < size; i++) {
printf("%d ", arr[i]);
}
}
int main() {
int nums[] = {10, 20, 30};
printArray(nums, 3);
return 0;
}
void totalScore(int scores[], int n) {
int total = 0;
for(int i = 0; i < n; i++) {
total += scores[i];
}
printf("Total UdaanPath Score: %d", total);
}
You must specify the column size in the parameter list:
void displayMarks(int marks[][3], int rows) {
for(int i = 0; i < rows; i++) {
for(int j = 0; j < 3; j++) {
printf("%d ", marks[i][j]);
}
printf("\n");
}
}
Structures can be passed either by value or by reference (using pointers).
struct Student {
char name[30];
int age;
};
void display(struct Student s) {
printf("Name: %s, Age: %d\n", s.name, s.age);
}
void update(struct Student *s) {
s->age += 1;
}
#include <stdio.h>
#include <string.h>
struct Course {
char title[50];
int duration;
};
void display(struct Course c) {
printf("Course: %s, Duration: %d hrs\n", c.title, c.duration);
}
void extend(struct Course *c, int extraHours) {
c->duration += extraHours;
}
int main() {
struct Course course1 = {"UdaanPath: Learn C Fast", 40};
display(course1);
extend(&course1, 5);
printf("After Extension:\n");
display(course1);
return 0;
}
Allows modification of actual variable values using their addresses.
void swap(int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
}
In the next chapter, we will explore Enumerations and Typedef — powerful tools for naming constants and simplifying data types.