Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Physics.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- //r = resistance
- //i = current
- //v = voltage=ir
- double r[10] = {4, 8.5, 6, 7.35,9, 15.3, 3, 5.4, 2.9,4.8};
- double i[10] = {10.62, 14.89,13.21,16.55, 18.62, 9.47, 6.58, 18.32, 12.15,3.98};
- double v[10];
- double *pVoltage = v;
- for (int x=0; x<10; x++,pVoltage++)
- {
- v[x]= r[x]*i[x];
- cout<<*pVoltage<<endl;
- //cout<< v[x]<< endl;
- }
- //pNumbers = pNumbers +1;
- //cout<<*pNumbers;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement