You are on page 1of 1

#include<stdio.

h>
#include<conio.h>
#include<math.h>
#define phi 3.145
int main()
{
float re,v,d,nu,a,g,hf,l,f,q;

printf("enter the length of pipe=");


scanf("%f",&l);
printf("\n enter the diamter of pipe=");
scanf("%f",&d);
printf("enter the kinematic viscosity=");
scanf("%f",&nu);
printf("\n enter the rate of flow of pipe=");
scanf("%f",&q);
a=(phi*d*d)/4;
v=q/a;
re=(v*d)/nu;
if(re<2000)
{
printf("\n flow is laminar");
f=64/re;
printf("\n friction factor,f=%f",f);

}
else if(re>4000)
{
printf("\n flow is turbulent");
printf("\n enter the g value");
scanf("%f",&g);
printf("\n enter the friction loss hf");
scanf("%f",&hf);
f=(2*g*d*hf)/(l*pow(v,2));
printf("\n friction factor,f=%f",f);

}
else if(re>2000 && re<4000)
{
printf("\n flow is transistion");

}
getch();
}

You might also like