Hai i wonder why my program cannot display the result of addition & multiply. Please advice me. I am using struct to run my programme. Here is the code
Code:
#include <stdio.h>
struct employee
{
int ID;
char name[15];
int salary;
int year;
int increment,increment1;
};
int main()
{
struct employee record;
int i,nu, salary, year;
printf( "Enter number of employee: " );
scanf("%d", &nu );
printf("\n\n\n");
for(i=0;i<nu;i++)
{
printf("Enter Employee number ID: ");
scanf("%d", &record.ID);
printf("Enter Employee Name: ");
scanf("%s", &record.name[15]);
printf("Enter Employee Salary: ");
scanf("%d", &record.salary);
printf("Enter Employee Service Year:");
scanf("%d", &record.year);
printf("\n\n");
if( record.year > 10)
{
record.increment = record.salary + (10 / 100);
printf("Congratulation your Latest Salary are 1 :%d", record.increment);
printf("\n\n");
}
else
{
record.increment1=( record.salary * 7/100) + record.salary ;
printf("Congratulation your Latest Salary are 2 :%d", record.increment1);
printf("\n\n");
}
}
return 0;
}
}