ask the user for 4 integer values
5. The quotient (real, with decimals) of the square root of the
sum of the squares divided by the sum of all the numbers.
the program runs all other operations expect #5.
How can i fix it?
Code:
#include <stdio.h>
#include <math.h>
int main()
{
int num[4];
printf("Enter 4 numbers seperated by a space in between each:\n");
scanf("%d %d %d %d",&num[0],&num[1],&num[2],&num[3]);
printf("The sum of the 4 numbers is : %d\n", num[0]+num[1]+num[2]+num[3]);
printf("The sum of the first two numbers minus the sum of the last two is : %d\n", (num[0]+num[1])-(num[2]+num[3]));
printf("The sum of the squares of the four numbers is : %d\n", (num[0]*num[0]+num[1]*num[1]+ num[2]*num[2]+num[3]*num[3]));
printf("The quotient of the square root of the sum of the squares divided by the sum of all the numbers is : %f\n", sqrt(num[0]*num[0]+num[1]*num[1]+ num[2]*num[2]+num[3]*num[3])/(num[0]+num[1]+num[2]+num[3]);
return (0);
}