cpp: #include <stdlib.h>  \nint main(int argc, char* argv[])  \n{\n  int i;\n  int len=100;\n\n  if (argc>1)\n    len = atoi(argv[1]);\n\n  int numNodes=len, numNodes2=0; \n  int x[len]; \n\n  for (i=0; i< len; i++)\n  {\n    if (i%2==0)\n      x[i]=5;\n    else\n      x[i]= -5;\n  }\n\n#pragma omp parallel for\n  for (i=numNodes-1 ; i>-1 ; --i) {\n    if (x[i]<=0) {\n      numNodes2-- ;\n    }\n  }         \n  return 0;\n} \n
fortran: program DRB012_minusminus_var_yes\n    use omp_lib\n    implicit none\n\n    integer :: i, len, numNodes, numNodes2, argCount, allocStatus, rdErr, ix\n    character(len=80), dimension(:), allocatable :: args\n    integer, dimension (:), allocatable :: x\n\n    len = 100\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) len\n        if (rdErr /= 0 ) then\n            write (*,'(a)') "Error, invalid integer value."\n        end if\n    end if\n\n    allocate (x(len))\n\n    numNodes=len\n    numNodes2=0\n    !initialize x()\n    do i = 1, len\n        if (MOD(i,2) == 0) then\n            x(i) = 5\n        else\n            x(i) = -5\n        end if\n    end do\n\n    !$omp parallel do\n    do i = numNodes, 1, -1\n        if (x(i) <= 0) then\n            numNodes2 = numNodes2-1\n        end if\n    end do\n    !$omp end parallel do\n\n    print*,"numNodes2 =", numNodes2\n\n    deallocate(args,x)\nend program