#include<stdio.h>
void main()
{
    float a,l,p,w,m,r,b,h,x,c,q,i,sf,bm,ss,fs;
    printf("Enter the value of a,l,p,w,b,h,x=\n");
    scanf("%f%f%f%f%f%f%f",&a,&l,&p,&w,&b,&h,&x);
    r=p+(w*l);
    m=(p*a)+(w*l*l*0.5);
    c=h/2;
    q=(b*h*h)/8;
    i=(b*h*h*h)/12;
    if(x<a){
    for(x=0;x<a;x=x+(l/10))
    {
        sf=r-(w*x);
        bm=-m+(r*x)-(w*x*x*0.5);
        ss=(sf*q)/(i*b);
        fs=(bm*c)/i;
    printf("\n Distance=%.2f,Shear force=%.2f,Bending moment=%.2f,Shearing stress=%.2f,Flexural stress=%.2f",x,sf,bm,ss,fs);

    }}
    else if(x>=a){
    for(x=a;x<=l;x=x+(l/10))
    {
        sf=r-p-(w*x);
        bm=-m+(r*x)-(p*(x-a))-(w*x*x*0.5);
        ss=(sf*q)/(i*b);
    printf("\n Distance=%.2f,Shear force=%.2f,Bending moment=%.2f,Shearing stress=%2f,Flexural stress=%.2f",x,sf,bm,ss,fs);
    }}
}
