How can I simplify nested-if statements
Hello, I'm considering the way to simplify nested-if statements in a row, but I stuck in here. #include <stdio.h> int main() { float profit, clients, bonus; /* printf("Enter your profit and clients: \n"); scanf("%f %f", &profit, &clients); bonus = (profit > 500 & clients > 10) ? profit * clients : profit * clients * 0.3; printf("You'll get %.2f as your bonus \n", bonus); This is what I am working now.. but how can I put secone 'else' statement in the sentense? */ if (profit > 500) { if (clients > 10) { bonus = profit * clients; printf("You'll get %.2f as your bonus", bonus); } else { bonus = profit * clients * 0.3; printf("You'll get %.2f as your bonus", bonus); } } else { bonus = profit * clients * 0.1; printf("You'll get %.2f as your bonus", bonus); } return 0; }