A for Loop Over an Array - C++ Statement

C++ examples for Statement:for

Description

A for Loop Over an Array

Demo Code

#include <iostream> 
  
using namespace std; 
  
int main(int argc, const char * argv[]) 
{ 
        unsigned int array[10]; 
      //ww  w .ja  va2s  .c  om
        for (unsigned int i=0; i<10; ++i) 
        { 
            array[i] = i * 2; 
            cout << "Loop Iteration: " << array[i] << endl; 
        } 
      
        return 0; 
}

Result


Related Tutorials