Run ❯
×
Change Orientation
Change Theme, Dark/Light
#include
int main() { // Create variables of different data types int items = 50; float cost_per_item = 9.99; float total_cost = items * cost_per_item; char currency = '$'; // Print variables printf("Number of items: %d\n", items); printf("Cost per item: %.2f %c\n", cost_per_item, currency); printf("Total cost = %.2f %c\n", total_cost, currency); return 0; }
Number of items: 50
Cost per item: 9.99 $
Total cost = 499.50 $