calling function - Modular Programming - Functions C Programs - C Programming
Function call without parameters.
/* C Program to call function without parameters */
#include <stdio.h>
main()
{
/* Statements */
message(); /* message is a function call without parameters */
printf("Main_Message");
} /* main */
message()
{
printf("Function Message\n");
} /* message */ 1*
OUTPUT
Function Message
Main Message
EXPLANATION: When the function message() is called the control passes to the function message(). The activity of main() is temporarily suspended. The message() function runs, the statements are executed and the control returns next line from where the function is called in main program.
NOTE: main() function becomes calling function, where as message() function becomes the called function.
Computer Programming C Laboratory: Functions C Programs : Tag: C Programming : - C Program to call function without parameters