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
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Functions – Declaration | C Programming Fundamentals lesson | BraveProgrammer
  1. Courses
  2. /
  3. C Programming Fundamentals

Lesson 11 of 50

·c

Functions – Declaration & Definition

10 mins

Course progress22%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • Return type appears before the function name.
  • If a prototype is missing, the compiler assumes `int` (pre‑C99) – avoid this.
  • Parameters are passed **by value** (copies).
  • `void` as a parameter list means *no arguments*.

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
", sum);
    return 0;
}

/* Definition */
int add(int a, int b) {
    return a + b;
}
Make it stickPractice what you've learned1 quiz · 3 practical tests · Optional activities from C Programming FundamentalsBrowse activities
Previous lessonLoops – forContinue to lesson 12Variable Scope & Storage ClassesBack to C Programming Fundamentals curriculum