Functions
Function definition, parameters, and return types; defining before main.
Simple enough for a 5-year-old to understand
Functions and return
Functions are defined BEFORE main (otherwise a prototype is required). Write the return type, name, and parameters.
#include <stdio.h>int square(int x) { return x * x;}int main() { printf("%d\n", square(5)); return 0;}🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)
🎯 Expected output: 17