EmbLogic's Blog

weekly wage with Overtime

 

 

1 #include <stdio.h>
2 int main()
3 {
4         int a,b,c, pay1, pay2, pay;
5         printf(“enter daily working hours\n”);
6         scanf(“%d”, &a);
7         b= a * 6;
8         printf(“weakly hours are %d\n”, b);
9         if (b > 40)
10         {
11         c= b – 40;
12         printf(“%d is overtime\n”, c);
13         }
14         else
15         {
16         c=0;
17         }
18         if (b > 40)
19         {
20         pay1= 40 * 300;
21         pay2=c * 400;
22         pay= pay1 + pay2;
23         printf(“pay is %d”,pay );
24         }
25         else
26         {
27         pay = b * 300;
28         printf(“pay is %d”, pay);}return 0;
29         return 0;
30 }
~

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>