Skip to main content

Posts

Showing posts with the label Function

Types of Function in C language return type function (argument) use

 Function use example: 1. Function with no argument (parameters) & no return value: Basic example program addition #include<stdio.h> void add(void); int main() { add(); } void add() { int x,y=56,z=45; x=y+z; printf("ADD=%d",x); } Output are: ADD=101 2. Function with no argument but return type: Here called function is independent and are initialized . The value aren't passed by The calling function .Here the calling function and called function are communicated party with each other.   Basic example program addition #include<stdio.h> int  add(void); int main() { add(); } int add(void) { int x,y=56,z=45; x=y+z; printf("ADD=%d",x); } Output are: ADD=101 3. Function with argument but no return value Here the function have argument so the calling function send date to the called function but called function dose not return value. Here the result obtained by the called function.   Basic example program addition #include<stdio.h> void add(int y,