2
2
#include<stdio.h>
#include<math.h>
int main()
{
double N,P,M,EFF,tmp;
printf("Caculate the cycle efficiency of a gas turbine plant\n");
printf("Enter index ratio[N] and preasure ratio [P]:\n");
scanf("%lf%lf",&N,&P);
tmp=log(P);
M=exp( (1-1/N)*tmp );
EFF=1-1/M;
printf("%.6lf\t%.6lf\n%.2lf\n",N,P,M);
printf("The cycle efficiency,EFF=%.2lf",EFF);
return 0;
}
#include<stdio.h>
#include<math.h>
#define PI 3.1415926
int main()
{
double Resistance,Length,Diameter,tmp=0.43,A;
printf("Caculate the resistance of the cylindrical made of Germanius\n");
printf("Enter the length and the diameter :\n");
scanf("%lf%lf",&Length,&Diameter);
A= PI*Diameter*Diameter/4;
Resistance=tmp*Length/A;
printf("Length=%.6lf m\tDiameter=%.6lf m\n",Length,Diameter);
printf("The Resistance is %.2lf ohms", Resistance);
return 0;
}