Answer to Question #17970 in C++ for apoorva

Question #17970
Write a complete C++ program that reads a float array having 15 elements. The program uses a function reverse() to reverse this array. Make suitable assumptions wherever required.(avoid use of printf,getline,etc.)
1
Expert's answer
2012-11-06T09:39:40-0500
#include <iostream>
using namespace std;


int main(){
float array[15], arrayq[15];
for (int i = 0 ; i < 15 ; i++){
& cin>>array[i];
}
for(int i = 0 ; i < 15 ; i++){
& arrayq[i] = array[14-i];
}


for (int i = 0 ; i < 15 ; i++){
& cout<<arrayq[i]<<' ';
}

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS