the flow of control of the program always goes to the else block even if the condition inside the if/else-if statement is true. The variable salary does not get assigned to any of the necessary values (because I'm assigning the values to the variable inside the if/else-if block.
There's no syntax errors (at least none shown by the compiler).
#include <stdio.h>
#include <stdlib.h>
int main()
{
int ID, days = 30, exp, bonus;
long int salary;
char nm[30], typ[30];
printf("Enter the employee name\n");
//gets(nm);
scanf("%[^\n]", &nm);
printf("Enter the employee ID\n");
scanf("%d", &ID);
fflush(stdin);
printf("Enter the type of employee\n");
scanf("%[^\n]", &typ);
if (typ == "Permanent" || typ == "P" || typ == "p" || typ == "permanent")
salary = 1000 * days;
else if (typ == "Temporary" || typ == "t" || typ == "T" || typ == "temporary")
salary = 400 * days;
else
printf("Invalid type\n");
printf("Enter the years of experince the employee has\n");
scanf("%d", &exp);
bonus = exp * 1000;
salary += bonus;
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
printf("--------Employee salary slip--------\n");
printf("`````````````````````````````````````\n");
printf("Employee Name : %s\n", nm);
printf("Employee ID : %d\n", ID);
printf("Type : %s\n", typ);
printf("Salary : %li", salary);
return 0;
}