C Exercises: Find the maximum number between two numbers
6. Maximum of Two Using Pointer
Write a program in C to find the maximum number between two numbers using a pointer.
Visual Presentation:

Sample Solution:
C Code:
Sample Output:
Pointer : Find the maximum number between two numbers : ------------------------------------------------------------ Input the first number : 5 Input the second number : 6 6 is the maximum number.
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C program to compare two integers using pointers and return the pointer to the larger value.
- Write a C program to determine the maximum of two numbers via pointers and then swap them if the first is smaller.
- Write a C program to find the maximum number between two variables using call by reference and pointer dereferencing.
- Write a C program to compare two numbers with pointers and print the address and value of the maximum element.
C Programming Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a program in C to add numbers using call by reference.
Next: Write a program in C to store n elements in an array and print the elements using pointer.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.