#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(){
int a = 100;
int b = 2000;
return a+b;
}
/*---------------------*/
void print_hello(){//반환값, 매개변수x
printf("hello\n");
}
/*---------------------*/
/*
선언->호출->정의
*/
To embed this project on your website, copy the following code and paste it into your website's HTML: