Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include "Physics.h"
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. //r = resistance
  8. //i = current
  9. //v = voltage=ir
  10. double r[10] = {4, 8.5, 6, 7.35,9, 15.3, 3, 5.4, 2.9,4.8};
  11. double i[10] = {10.62, 14.89,13.21,16.55, 18.62, 9.47, 6.58, 18.32, 12.15,3.98};
  12. double v[10];
  13. double *pVoltage = v;
  14.  
  15. for (int x=0; x<10; x++,pVoltage++)
  16. {
  17.  
  18. v[x]= r[x]*i[x];
  19. cout<<*pVoltage<<endl;
  20. //cout<< v[x]<< endl;
  21.  
  22. }
  23.  
  24.  
  25. //pNumbers = pNumbers +1;
  26. //cout<<*pNumbers;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement