{}

Build your resume with HTML & CSS and win $100

Get featured on Programiz PRO and the Wall of Inspiration.

Build your resume with HTML & CSS and win $100

Join Challenge →
Join Challenge →

Build your resume with HTML & CSS and win $100

Get featured on Programiz PRO and the Wall of Inspiration.

Build your resume with HTML & CSS and win $100

Join Challenge →
Join Challenge →
run-icon
main.c
// Online C compiler to run C program online #include <stdio.h> int main() { int hours; float price; printf("hours : "); scanf("%d\n", &hours); if (hours <= 2) { price = hours * 2.0; } else if (hours > 2 && hours <= 4) { price = 2 * 2.0 + (hours - 2) * 1.5; } else { price = 2 * 2.0 + 2 * 1.5 + (hours - 4) * 1.0; } printf("Your price is: %.2f\n", &price); return 0; }
Output