C Program Of Adding Two No.Using Function Without Argument And Return Value

//Add two no.using Function with no argument and return value


int add(void);       //function declaration


 int Add;

  Add=add();       //function call (main function not passing any value to function add).bcuz argument type void

  printf("Addition of a and b is:%d",Add);



int  add(void)     //function definition (If declaration of Function definition before function main() then no need of function declaration

   int a,b,c;
   printf("\n");    //newline

   printf("Enter value of a:");     //user give input


   printf("Enter value of b:"); //user give input

   c=a+b;    //add both a and b

   return c;     //used bcuz return type is int so value passed to function main where function add() called

Related Posts