Sail E0 Webinar
Question

Functions cannot return a floating point number


Options:
A .  Yes
B .  No
Answer: Option B


A function can return floating point value.
Example:


#include<stdio.h>
float sub(float, float); /* Function prototype */
int main()
{
float a = 4.5, b = 3.2, c;
c = sub(a, b);
printf("c = %f\n", c);
return 0;
}
float sub(float a, float b)
{
return (a - b);
}


Output:
c = 1.300000



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers