Program to calculate Salary & loan Issue structure of an employee

An employee can apply for a loan at the beginning of every six months but he will be sanctioned the amount according to the following company rules:

Rule 1: An employee cannot enjoy more than two loans at any point of time.

Rule 2: Maximum permissible total loan is limited and depends upon the category of the employee.




#include
#define MAXLOAN 50000
main()
{
long int loan1, loan2, loan3, sancloan, sum23;
clrscr();
printf("Enter the values of previous two loans:\n");
scanf("%ld %ld", &loan1, &loan2);
printf("\nEnter the value for new loan:\n");
scanf("%ld", &loan3);
sum23=loan2+loan3;
sancloan=(loan1>0) ? 0 : ((sum23>MAXLOAN) ? MAXLOAN-loan2 : loan3);
printf("\n\n");
printf("Previous loans pending:\n%ld %ld\n", loan1, loan2);
printf("Loan requested = %ld\n", loan3);
printf("Loan sanctioned = %ld\n", sancloan);
getch();
}

Related Links :

No comments:

Post a Comment


If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE


More Useful Topics...

 

History Of C..

In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.

My 1st Program...


#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t*******Pankaj *******\n");
printf ("\t\t\t********************************\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}

Next Step...


#include
#include

void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");

printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");

getch ();

}

Hits!!!