Question #329331

  1. Your task is to implement the function definition of the cheerUp() function. The cheerUp() function should update the values passed by multiplying each of them by 3.

Expert's answer

#include <stdio.h>

void cheerUp(int *a)
{
  *a = (*a) * 3;
}

int main() {
    int num;
       printf("Enter value: ");
       scanf("%d", &num);
       cheerUp(&num);
    printf("value * 3 = %d", num);
}
LATEST TUTORIALS
APPROVED BY CLIENTS