pow and sqrt are overloaded to take doubles, floats and all sorts of integers even. So your program might be written:
Code:
#include <stdio.h>
#include <math.h>
int main (void) {
double a, b, c, d, e;
fputs("Enter 5 decimals: ", stdout);
scanf("%lf %lf %lf %lf %lf", &a, &b, &c, &d, &e);
double sum_of_powers = pow(a, 2)
+ pow(b, 2)
+ pow(c, 2)
+ pow(d, 2)
+ pow(e, 2);
double length = sqrt(sum_of_powers);
printf("The square root of the sum is %lf\n", length);
return 0;
}
Notice the lack of typecasting.