Here is the code for you:
#include <stdio.h>
void reverse_array (double data[ ], int n)
{
for(int i = 0; i < n/2; i++)
{
int temp = data[i];
data[i] = data[n-i-1];
data[n-i-1] = temp;
}
}
int main()
{
double Array[20];
int n;
printf("Enter the number of elements: ");
scanf("%i", &n);
printf("Enter %i elements into the array: ", n);
for(int i = 0; i < n; i++)
scanf("%lf", &Array[i]);
printf("Before Reversing: ");
for(int i = 0; i < n; i++)
printf("%.2lf ", Array[i]);
printf("\n");
reverse_array(Array, n);
printf("After Reversing: ");
for(int i = 0; i < n; i++)
printf("%.2lf ", Array[i]);
printf("\n");
}
And the output screenshot is:
Write a C program using array(s) that inputs 20 real numbers, then displays it backward on...
Write a program that inputs up to 100 real numbers from the keyboard (one at a time). When a number greater than 1.0e9 is input the keyboard input will stop. Then the following statistic for the input data will be computed and printed out to the screen. a) average b) standard deviation c) minimum value d) maximum value e) range = (maximum-minimum)/2 f) the number of times zero is input **Note: this is a program in C++** 3) Write a...
write a c++ program: User enter in 5 numbers, stores them in an array then displays them from least -> greatest. Then create a char array the user will enter some letters, it gives a count on every 'a' then it gets replaced by an uppercase 'A'. Display the result. Then display only the last letter.
Write a C program that asks the user to enter two real numbers. Then your program displays a menu that asks the user to choose what arithmetic operation to be done on those numbers. Depending on the user's entry, the program should display the result to the screen. The sample runs below show what should be done to the numbers entered by the user. Your program should run exactly like shown in the sample runs. make your code run as...
Write a C Program that inputs an array of integers from the user along-with the length of array. The program then prints out the array of integers in reverse. (You do not need to change (re-assign) the elements in the array, only print the array in reverse.) The program uses a function call with array passed as call by reference. Part of the Program has been given here. You need to complete the Program by writing the function. #include<stdio.h> void...
c++ no pointers just follow instructions Write a program (array.cpp) that read positive floating point numbers into an array of capacity 100. The program will then ask for one of three letters(A, M or S). if the user inputs something other than one of these letters, then the program should ask for that input until an A, M, or S is entered. A do-while loop should be used for this. If the user inputs an A, then the program should...
Write a C++ program that has an array of 20 integer numbers. It should call a function to initialize the array. Then it should call a function to find the smallest and average of the array.
(Printing Series) Write a program that displays numbers for a given number, n to 1 using for statement.
Write a C program that uses the random number generator rand( ) to create an array with 20 numbers with value in the range from 1 to 100. The program calculates and displays the difference between the largest array element and the second largest array element in the array.
6. Consider a C program that reads two real numbers from the keyboard followed by a character where the character can be one of the operators +,-, *, 1, or % providing the addition, subtraction, multiplication, division, or remainder respectively. Then the result is displayed on the screen For example, if the user types 2.0 3.0 % then your code will display: Note: In the above example the inputs are real numbers but the remainder only performs an integer operation....
Write a JAVA program that declares and initializes an array with the following numbers: 10, 89, 50, 24, 60, 1, 15. Then ask the user for a number and check if the array contains that number. If it does, return a message to the user (print to screen) that says