Find Asset or liabilities or owner's equity

#include
int main (void)
{
    //asset=x,liabilities=y, owenereqity=z;
    double x,y,z;
    char a,l,o,m;
    printf("for asset, libilities and owners eqity write a, l, o\n");
    scanf("%c", &m);

       if(m=='a')
       {      
            printf("Please 1st enter liabilities and then enter owners eqity\n");
            scanf("%lf %lf", &y,&z);
            printf("%lf", x=y+z);
    }
       else if(m=='l')
       {
         printf("Please 1st enter asset and then enter owners eqity\n");
         scanf("%lf %lf", &x, &z);
         printf("%lf", y=x-z);
    }
    else if(m=='o')
       {
         printf("Please 1st enter asset and then enter liabilities\n");
         scanf("%lf %lf", &x, &y);
         printf("%lf", z=x-y);
                 
    }
    else
    {
        printf("you enter a wrong character\n");
    }
    system("pause");
    return 0;
}

0 comments:

Post a Comment