Tuesday, June 19, 2012

Simple array program

#include <iostream>
using namespace std;

int main()
{
    int numbers[10];
    int i;
   
    for (i=0; i<10; i++)
        numbers[i] = i + 1;
       
    for (i=0; i<10; i++)
        cout << i << ": " << numbers[i] << endl;
       
    return 0;
}


OUTPUT:

No comments:

Post a Comment