Code
/*
* -----------------------------------------------------------
* Logic Building with Computer Programming (CSU1128)
* Instructor: Dr. Pankaj Vaidya | Author: Divya Mohan
*
* This code is a part of the educational initiative by dmj.one
* with aim of empowering and inspiring learners in the field of
* Computer Science and Engineering through the respective courses.
*
* (c) 2022, Divya Mohan for dmj.one. All rights reserved.
* -----------------------------------------------------------
*/
#include <stdio.h>
int main()
{
float d, m, j;
printf("\n\n Program to calculate the insurance premium as per the following norms:");
char o[10][10] = {"%"};
printf("\n\t - if premium is less than 10,000 then a VAT is 10%s of the premium.", o[0]);
printf("\n\t - else VAT is 15%s of the premium. \n\n", o[0]);
printf("Enter the premium amount - (Example: 23232) - and press enter: ");
scanf("%f", &d);
if (d < 10000)
{
m = 10;
}
else
{
m = 15;
}
j = d + d * m / 100;
printf("\n Total premium for the entered amount is %.2f with %.2f as added VAT to it. \n", j, d * m / 100);
return 0;
}
Output
Program to calculate the insurance premium as per the following norms:
- if premium is less than 10,000 then a VAT is 10% of the premium.
- else VAT is 15% of the premium.
Enter the premium amount - (Example: 23232) - and press enter: 44352
Gross salary of the employee is 111067.80 with 13066.80 as HRA and 32667.00 as DA amount given
to them.