• Language

    C

  • Description

    It allows an user to enter an hourly pay rate and hours worked. The program outputs the user’s gross pay.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <stdlib.h>

int main (void)
{
    float gross_pay, hourly_pay_rate, hours_worked;
    printf ("Enter the value of hourly pay rate: ");
    scanf ("%f", &hourly_pay_rate);
    (void) getchar ();
    printf ("Enter the value of hours worked: ");
    scanf ("%f", &hours_worked);
    (void) getchar ();
    gross_pay=hours_worked*hourly_pay_rate;
    printf ("Value of gross pay: %g\n", gross_pay);
    putchar ('\n');
    system ("pause");
    return EXIT_SUCCESS;
}