Write a program to prompt the user for hours and rate per hour to compute gross pay.
Enter hours:35
Enter rate:2.75
Pay:96.2
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
int main(){
int hours;
float rate,pay;
printf("Enter hours: ");
scanf("%d",&hours);
printf("Enter rate: ");
scanf("%f",&rate);
pay=hours*rate;
printf("Pay: %.1f",pay);
scanf("%f",&rate);
return 0;
}
Comments
Leave a comment