Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Test expression



Comment



Working with switch case



Specifer



" ; " after loop




Profit or loss on selling goods



// AHF C PROGRAM SOLVING

//solving here basic type of programming problem

#include<stdio.h> #define pf printf int main() { int a,b,x,y; pf("\nEnter the value a and b: "); scanf("%d %d",&a,&b); x=a-b; y=b-a; if(a<b) pf("\nThe total profit= %d",y); else pf("\nThe loss from buying price= %d",x); return 0; }
OUTPUT:


© 2018 - All rights reserved