Array Index is from 0 to length -1 - C++ Data Type

C++ examples for Data Type:Array

Description

Array Index is from 0 to length -1

Demo Code

#include <iostream>
using namespace std;
int main() {/*  w  ww.j  ava  2  s.co  m*/
   int a[10];
   for(int i = 0; i < 10; i++) {
      a[i] = i * 10;
      cout << "a[" << i << "] = " << a[i] << endl;
   }
}

Result


Related Tutorials