Jumat, 12 Desember 2025

listing4.1.cpp myNumbers[5]

//listing4.1.cpp
#include <iostream>
using namespace std;

int main()
{
    int myNumbers[5]={34,56,-21,5002,365};

    cout << "First element at index 0: " << myNumbers[0] << endl;
    cout << "Second element at index 1: " << myNumbers[1] << endl;
    cout << "Third element at index 2: " << myNumbers[2] << endl;
    cout << "Fourth element at index 3: " << myNumbers[3] << endl;
    cout << "Fifth element at index 4: " << myNumbers[4] << endl;

    return 0;
}

output:
 
First element at index 0: 34
Second element at index 1: 56
Third element at index 2: -21
Fourth element at index 3: 5002
Fifth element at index 4: 365

Process returned 0 (0x0)   execution time : 0.095 s
Press any key to continue.

Tidak ada komentar:

Posting Komentar