User-defined function SUM

PHOTO EMBED

Thu Apr 11 2024 06:05:06 GMT+0000 (Coordinated Universal Time)

Saved by @kervinandy123 #c

#include <stdio.h>

float sum( float n1, float n2);
int main()
{
    float m, n, total;
    printf("Enter first number:");
    scanf("%f", &m);
    printf("Enter second number:");
    scanf("%f", &n);
    total=sum(m ,n);
    
printf("The sum of the two numbers is %.2f", total);
    
    
}
float sum(float n1, float n2)
{
return (n1+n2);
}
    
    
content_copyCOPY