Declare array unsigned int 'values' with 5 elements and initialize the elements to even ints from 2 - 10. - C++ Data Type

C++ examples for Data Type:int

Description

Declare array unsigned int 'values' with 5 elements and initialize the elements to even ints from 2 - 10.

Demo Code

#include <iomanip>
#include <iostream>

int main(int argc, const char *argv[]) {
  const int SIZE = 5;

  unsigned int values[SIZE] = { 2, 4, 6, 8, 10 };


  for (int i = 0; i < SIZE - 1; ++i)
  {/*from w  w  w. j  av  a 2 s .com*/
    std::cout << values[i];
  }
}

Result


Related Tutorials