Write a C program to interchange the largest and the smallest number in array. Enter number of elements: 5 Enter the elements: 1 2 3 4 5 The smallest element is: 1 The position: 0 The Largest element: 5 The position: 4 The new array is: 5 4 3 2 1
Added by Gabriel G.
Step 1
- We need to create a C program that finds the smallest and largest elements in an array. - Then, we need to interchange their positions. - Finally, we need to display the modified array. Show more…
Show all steps
Your feedback will help us improve your experience
Wei Yang and 70 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a C++ program to find the second smallest element in an array.
Chandra J.
Write a C++ program to find the largest& smallest of three numbers Using inline function MAX and MIN.
Samuel G.
Write a program in C++ to find largest number among three numbers.
James K.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD