I asked a student to write a Function if Salary is greater than 10 thousand than give that employe a salary increment of 15%, 20% if greater than 20 thousand, 25% abv to 30000/-
He wrote
void IncremetSalary(){
if(salary > 10000){
int newSalary = (int)salary * 0.15;
print("1500");
}
else if(salary > 20000){
int newSalary = (int)salary * 0.20;
print("4000");
}
}
i repeat him 4 times, but he always prints 1500 ... 4000 :-(