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

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


void add(void);    //function declaration


 add();     //function call (main function not passing any value to function add)


void  add(void)    //function definition

   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
   printf("Value of c is:%d",c);    //print value of c

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


Related Posts