Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. C Programming Fundamentals

Lesson 11 of 50 · c

Functions – Declaration & Definition

Duration: 10 mins

Functions encapsulate reusable code. A prototype (declaration) tells the compiler about the function’s name, return type, and parameters before it is used.

/* Prototype */
int add(int a, int b);

int main(void) {
    int sum = add(3, 4);
    printf("%d\n", sum);
    return 0;
}

/* Definition */
int add(int a, int b) {
    return a + b;
}
Previous: Loops – forNext: Variable Scope & Storage Classes