[ create a new paste ] login | about

Link: http://codepad.org/ipZlCncf    [ raw code | output | fork ]

C, pasted on Aug 15:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include<stdio.h>
	main(void)
{
	float gs,bs,hra,da;
	printf ("enter the basic salary\n");
	scanf ("%f",&bs);
	if (bs<1500)
	{
		hra = 10/100*bs;
		da = 90/100*bs;
	}
		else
		{
			hra = 500;
			da = 98/100*bs;
		}
			gs = (hra + bs + da);
		printf("gross salary = Rs %f\n",gs);
		return 0;
}


Output:
1
2
enter the basic salary
gross salary = Rs 0.000000


Create a new paste based on this one


Comments: