Array C++ Programs.docx - To Understand about 1 Apply Arrays in C 2 Use of One Dimesional Array Task 1 Write a program to input array elements and

Array C++ Programs.docx - To Understand about 1 Apply...

This preview shows page 1 - 2 out of 2 pages.

To Understand about: 1. Apply Arrays in C++ 2. Use of One Dimesional Array Task 1 Write a program to input array elements and output is labeled, like this: Program: #include <iostream> using namespace std; int main() { float array[5] = { 0 }; cout << "Please, Enter 5 Numbers: " << endl; for ( int i = 0; i <= 4; i++) { cout << "\ta[" << i << "] : " ; cin >> array[i]; } cout << endl; cout << "In reverse order, they are: " << endl; for ( int i = 4; i >= 0; i--) { cout << "\ta[" << i << "] = " << array[i] << endl; } system( "pause" ); return 0; Output:
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Fall '18
  • Zia Ul Rehman
  • Multiplication, Array, Carriage return

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture