Operators
Eid Gift Boxes
Determine total gifts prepared and overall cost for Eid celebrations.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Determine total gifts prepared and overall cost for Eid celebrations.
| Input | Relatives: 12, Extra gifts: 3, Price per gift: 15 |
| Expected Output | Total gifts = 15, Total costs = 255 |
#include <stdio.h>
int main() {
int relatives, extra, price;
int totalGifts, totalCost;
printf("Enter number of relatives: ");
scanf("%d", &relatives);
printf("Extra gifts: ");
scanf("%d", &extra);
printf("Enter price of each gift: ");
scanf("%d", &price);
totalGifts = relatives + extra;
totalCost = totalGifts * price;
printf("total gifts = %d\n", totalGifts);
printf("total costs = %d\n", totalCost);
return 0;
}
Enter number of relatives: 12
Extra gifts: 3
Enter price of each gift: 15
total gifts = 15
total costs = 255