Function prototypes should be placed outside the main() function and before the main() function starts - C Function

C examples for Function:Function Definition

Description

Function prototypes should be placed outside the main() function and before the main() function starts

Demo Code

#include <stdio.h> 

int addTwoNumbers(int, int);  //function prototype 

int main() { /* www . j  a  v  a  2  s .  c  om*/
   printf("prototyped");
   return 0;
} 

Result

More function prototypes.

Demo Code

#include <stdio.h> 

int addTwoNumbers(int, int);  //function prototype 
int subtractTwoNumbers(int, int);  //function prototype 
int divideTwoNumbers(int, int);  //function prototype 
int multiplyTwoNumbers(int, int);  //function prototype 

int main() { //  w ww .  ja  va 2  s  .c o m
   printf("prototyped again");
   return 0;
}

Result


Related Tutorials