Answers for "C function that recieves pointer"

C
0

C function that recieves pointer

#include <stdio.h>
void salaryhike(int  *var, int b)
{
    *var = *var+b;
}
int main()
{
    int salary=0, bonus=0;
    printf("Enter the employee current salary:"); 
    scanf("%d", &salary);
    printf("Enter bonus:");
    scanf("%d", &bonus);
    salaryhike(&salary, bonus);
    printf("Final salary: %d", salary);
    return 0;
}
Posted by: Guest on August-23-2021

Code answers related to "C"

Browse Popular Code Answers by Language