fork(2) download
  1. #include <stdio.h>
  2. #include <math.h>
  3. double VecNorm(double V[], int dim)
  4. {
  5. int i = 0;
  6. double SQRSUM = 0.0;
  7. for ( i = 0; i < dim; i++)
  8. {
  9. SQRSUM += V[i] * V[i];
  10. }
  11.  
  12. return sqrt(SQRSUM);
  13.  
  14. }
  15. int main()
  16. {
  17. double x[3]={1,2,3};
  18. double y=0;
  19. printf("Hello, World! y=%f \n",VecNorm(x,3));
  20.  
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
Hello, World! y=3.741657