[ create a new paste ] login | about

Link: http://codepad.org/kK5hr2PS    [ raw code | fork ]

C, pasted on Jan 20:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define g 9.81
#define sigb 270

int main () 
{
int i,e,f;
float b, h, t, A,Amax=0,Amin=0, X, W, m, F, l;
printf("Enter Mass[kg]:");
scanf("%f",&m);
printf("Enter Lenght[mm]:");
scanf("%f",&l);
W=m*g*l*0.25/sigb;
printf("\n");
for (i=300;i<=1200;i++)
{
    for (e=400;e<=1200;e++)
    {
        for (f=10;f<=25;f++)
         {
             X=(i*pow(e,3)-(i-2*f)*pow(e-2*f,3))/(6*e);
             A=i*e-(i-2*f)*(e-2*f);
             if (X>W && X<1.0001*W && i<e)
             printf("W = %.1f mm^3 A = %.1f mm^2 with b = %d mm, h = %d mm and t = %d mm\n\n", X,A,i,e,f);
         }
    }
} 
	system ("PAUSE");
	return 0;
}


Create a new paste based on this one


Comments: