C program to find distribution factor

                                /*program to find distribution factor*/
#include<stdio.h>
void main()
{
float sum,a,b,c,d,ans1,ans2,ans3,ans4;
clrscr();
printf("Enter the value of a:\n");
scanf("%f",&a);
printf("Enter the value of b:\n");
scanf("%f",&b);
printf("Enter the value of c:\n");
scanf("%f",&c);
printf("Enter the value of d:\n");
scanf("%f",&d);
sum=-(a+b);
ans1=sum*c;
ans2=sum*d;
ans3=ans1*0.5;
ans4=ans2*0.5;
printf("distribution
factor:-\nans1=%f\nans2=%f\nans3=%f\nans4=%f\n",ans1,ans2,ans3,ans4);
getch();
}
                         /*OUTPUT*/
Previous
Next Post »