cpp: #include <stdlib.h>\n#include <stdio.h>\nint main(int argc, char* argv[])\n{\n  int i ;\n  int inLen=1000 ; \n  int outLen = 0;\n\n  if (argc>1)\n    inLen= atoi(argv[1]);\n\n  int input[inLen]; \n  int output[inLen];\n  for (i=0; i<inLen; ++i) \n    input[i]=i; \n\n#pragma omp parallel for\n  for (i=0; i<inLen; ++i) {\n    output[outLen++] = input[i] ;\n  }  \n\n  printf("output[0]=%d\n", output[0]);\n  return 0;\n}\n
fortran: program DRB019_plusplus_var_yes\n    use omp_lib\n    implicit none\n\n    integer :: i, inLen, outLen, argCount, allocStatus, rdErr, ix\n    character(len=80), dimension(:), allocatable :: args\n    integer, dimension(:), allocatable :: input\n    integer, dimension(:), allocatable :: output\n\n    inLen = 1000\n    outLen = 1\n\n    argCount = command_argument_count()\n    if (argCount == 0) then\n        write (*,'(a)') "No command line arguments provided."\n    end if\n\n    allocate(args(argCount), stat=allocStatus)\n    if (allocStatus > 0) then\n        write (*,'(a)') "Allocation error, program terminated."\n        stop\n    end if\n\n    do ix = 1, argCount\n        call get_command_argument(ix,args(ix))\n    end do\n\n    if (argCount >= 1) then\n        read (args(1), '(i10)', iostat=rdErr) inLen\n        if (rdErr /= 0 ) then\n            write (*,'(a)') "Error, invalid integer value."\n        end if\n    end if\n\n    allocate (input(inLen))\n    allocate (output(inLen))\n\n    do i = 1, inLen\n        input(i) = i\n    end do\n\n    !$omp parallel do\n    do i = 1, inLen\n        output(outLen) = input(i)\n        outLen = outLen + 1\n    end do\n    !$omp end parallel do\n\n    print 100, output(0)\n    100 format ("output(0)=",i3)\n\n\n    deallocate(input,output,args)\nend program