Changing a number
The following is a simple C program that prompts the user for an integer and stores it in the variable x. The program prints the number, calls the subroutine "change_number" passing the number as an argument, and finally prints the number again: brbr#include<stdio.h> brbrvoid change_number(int x); brbrint main() br{ br int x; br printf("Enter the number x: "); br scanf("%d", &x); br printf("In the main program: x = %dn", x); br change_number(x); br printf("In the main program: x = %dn", x); br} brbr The task is to write the subroutine "change_number" that takes an integer, increases it by three and prints the changed number as shown in the example printout. Pay attention to the value of the variable "x" in different parts of the program. In the following exercise, the subroutine will be supplemented with pointers. br/p p/p /div












Other samples, services and questions:
When you use PaperHelp, you save one valuable — TIME
You can spend it for more important things than paper writing.