Advertisement
luizaspan

Prod escalar

May 28th, 2015
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #define N 15
  4.  
  5. int main(void)
  6. {
  7.   int i;
  8.   double x[]={1.0,2.0,3.0}, y[]={4.0,5.0,6.0}, xy;
  9.  
  10.   for (i=0;i<3;i++)
  11.     {
  12.       xy+=x[i]*y[i];
  13.     }
  14.  
  15.   printf("x escalar y = %lf \n",xy);
  16.  
  17.   return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement