1// passing a pointer to function in C
2// It increaments the salary of an employee
3
4
5#include <stdio.h>
6void salaryhike(int *var, int b)
7{
8 *var = *var+b;
9}
10int main()
11{
12 int salary=0, bonus=0;
13 printf("Enter the employee current salary:");
14 scanf("%d", &salary);
15 printf("Enter bonus:");
16 scanf("%d", &bonus);
17 salaryhike(&salary, bonus);
18 printf("Final salary: %d", salary);
19 return 0;
20}