Write a C program that reads in a lowercase character, converts it to uppercase and then displays the uppercase equivalent

C program that converts lowercase character to its uppercase equivalent and displays it

Explanation
Step 1: Read the lowercase character
Step 2: Convert the lowercase character to its uppercase by using the library function toupper()
Step 3: Display the converted uppercase character

Note:
The function toupper() used in this program is a library function which is generally included in the header file ctype.h and the purpose of this function is to convert the lowercase letter to its uppercase.

Output:

Write a program in C that reads a line of text into the computer and then writes back out in its original form

Below is the C program that reads a line of text into the computer and then writes back out in its original form

Explanation
Step 1: Read the line of text by using the library function gets() and store it in an array
Step 2: Display the read line by using the library function puts()

Program:

Output:

Passing pointers to functions in C

Pointers in C are often passed to a function as arguments. This allows data items within the calling portion of the program to be accessed by the function, altered within the function, and then returned to the calling portion of the program in altered form. We call this use of pointers in functions as passing arguments by reference (or by address or by location), in contrast to passing arguments by value.

When an argument is passed by value, the data item is copied to the function. Thus, any alteration made to the data item within the function is not carried over to the calling routine. However, when an argument is passed by reference (i.e., when a pointer is passed to a function), the address of a data item is passed to the function. The contents of that address can be accessed freely, either within the function or within the calling routine.

Moreover, any change that is made to the data item (i.e., to the content of the address) will be recognized in both, the function and the calling routine. Thus, the use of pointer as a function argument permits the corresponding data item to be altered globally from within the function.

Also see:
Understand difference between ordinary arguments, which are passed by value, and pointer arguments, which are passed by reference with help of an example