#include <stdio.h>

/*
반환형 함수이름(매개변수){
    코드
}
*/

int add(int a, int b); //함수 선언
void add2(int a, int b);
int minus();
void print_hello();

int main() {
    printf("%d\n", add(1, 2)); //함수 호출
    add2(5, 5);
    printf("%d\n", minus());
    print_hello();
 
}

int add(int a, int b){ //반환 값 O, 매개변수 O 함수 정의
    int c = a + b;
    return c;
}

void add2(int a, int b){ //반환 값 X, 매개변수 O
    printf("%d\n", a+b);
}

int minus(){ //반환 값 O, 매개변수 X
    int a = 100;
    int b = 2000;
    return b-a;
}

void print_hello(){ //반환 값 X, 매개변수 X
    printf("hello\n");
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: