There are several problems with your code.
First it probably doesn't even compile without errors or warnings.
You have failed to properly prototype your function bonus() so your compiler should tell you about this. Second, the use of default arguments and default return types is a very bad habit. You should always specify the return type and all parameters.
Also using the non-standard getch() function without including the proper include file should also cause problems.
they didn't cover constants yet? that seems very strange.
Since the compiler the op is using seems very outdated #defining the constant would probably be a better choice.
Code:
#include<stdio.h>
#define SIZE 5
void bonus(int a);
int main()
{
int salary[SIZE],i;
printf("Enter the salaries");
for(i = 0; i < SIZE; i++)
{
scanf("%d", &salary[i]);
bonus(salary[i]);
}
}
void bonus(int a)
{
int net, bon;
bon = 10 * a / 100;
net = a + bon;
printf("the net salary is%d", net);
}
I recommend you get a more up to date compiler, your's seems very outdated.
Jim