type name ( parameter1, parameter2, ...) { statements }(via: www.cpulsplus.com)
i have an example of functions to print a sentences and addition of two numbers. Lets see this :
#include <iostream.h>
#include <conio.h>
/*example*/
void sayHi(){
cout << "Hi There, How are You ? ";
}
int tambah(int a, int b){
return a + b;
}
/*main function*/
void main(){
sayHi(); /*call sayHi Function*/
int a = 20, b = 30;
int c = tambah (a,b);
cout << c ;
getch();
}
Sign up here with your email
ConversionConversion EmoticonEmoticon