No Arguments and With Return Values Function in C

This “No Arguments and With Return Values Function in C” page explains clearly how to write programs using classifications with example codes.


 

No arguments and With return values :

  • In the following example, function is not taking¬†input(void)
  • It returns float value from its definition.
  • Return value we need to collect into a variable of float type only.
  • Function prototype is mandatory to avoid warnings in the application

 

float fun(void);
void main(void)
{
float f;
f = fun();
printf(“returned value : %f\n”,f);
}
float fun(void)
{
return 34.56;
}

Share this