Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello I have little to no knowledge in coding, can someone help me write a very quick code in C++ that solves Ohms Law, V=I*R?

I know its super simple probably will take all of 10 minutes but I have no knowledge.

What I have tried:

I have tried to figure it out with google but have had no luck
Posted
Updated 13-Sep-20 10:58am

C++
volts = current * impedance;
There you go.
 
Share this answer
 
Comments
[no name] 13-Sep-20 12:05pm    
And what news you bring with that? OP allready mentioned 'V=I*R'
Rick York 13-Sep-20 12:09pm    
It does exactly what was asked. What is YOUR problem?
[no name] 13-Sep-20 12:12pm    
It does _repeat_ exactly what was asked. What is YOUR problem?
Rick York 13-Sep-20 13:06pm    
The text of the question is not valid C++ syntax and the solution is not repeating the question. What I posted is valid syntax and answers the question precisely.

MY problem is your clueless posting. Try reading the question again. It does not ask about prompting a user, reading a file, writing a GUI, or anything else.
[no name] 13-Sep-20 13:23pm    
"The text of the question is not valid C++ syntax"
So you expect a question needs to be ask in c++ :lol:
EOD
What about Learn C++ and write that code for yourself?

Tip: you may use cin and cout for some easy input/output.
 
Share this answer
 
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900