Untitled
unknown
plain_text
10 months ago
455 B
1
Indexable
#include <stdio.h> int main() { int numberOfBooks = 10; float totalCost = 200.00; char isMember = 'y'; // Apply discounts based on rules if (numberOfBooks > 3) { totalCost *= 0.9; // 10% discount } if (isMember == 'y') { totalCost *= 0.95; // Additional 5% discount for members } printf("Number of books purchased: %d\n", numberOfBooks); printf("Total cost: £%.2f\n", totalCost); return 0;
Editor is loading...
Leave a Comment