fork download
  1. #include<stdio.h>
  2. int main(){
  3. float x, salary;
  4. printf("Enter the number of sold items:");
  5. scanf("%f",&x);
  6. salary = (x!=40) ? ((x<40) ? (4*x+100) : (4.5*x+150)) : 300;
  7. printf("The salary is:%f",salary);
  8. return 0;
  9. }
Success #stdin #stdout 0s 9432KB
stdin
30
stdout
Enter the number of sold items:The salary is:220.000000