Thursday, October 29, 2020

C program to find profit or loss or nothing

#include <stdio.h>

int main() {

    float p,s;

    printf("Enter purchase & selling amount:");

    scanf("%f %f",&p,&s);

    if(p<s)

    {

        printf("Profit=%.2f",s-p);

    }

    else if(p>s)

    {

        printf("Loss=%.2f",p-s);

    }

    else

    {

        printf("No profit or loss");

    }

}

No comments:

Post a Comment

મારી જિંદગીના સૌથી મોટા પ્રેરણારૂપ: મમ્મીને જન્મદિવસની ખાસ શુભેચ્છાઓ 🎂✨

  https://www.youtube.com/watch?v=m4zfFxLUI7c હાય નમસ્તે જય શ્રી કૃષ્ણ સો ઓકે આ પહેલો મારો વિડીયો હશે જે હું ગુજરાતીમાં રેકોર્ડ કરવાની હતી ર...