Q&A Discussies
hey guys, I've been trying to work out the formula 'v=I*r'. But whenever I run the program and input values for I and r, it doesn't give the right answer.
This is the code
#include <iostream>
using namespace std;
int main() {
int i,r;
int v = i*r;
cout<<"what is the value of i?\n";
cin>>i;
cout<<"what is the value of r?\n";
cin>>r;
cout<<"voltage ="<<v<<endl;
return 0;
}
p/s: I'm new to programming
1 Stem
8 Antwoorden6.1 c++
0 Stemmen
3 AntwoordenWhat's the problem of my code
0 Stemmen
3 AntwoordenInput and output
-3 Stemmen
5 AntwoordenWhat is cin?
0 Stemmen
5 Antwoordenc++ user input
0 Stemmen
2 Antwoordenconsole input activation
0 Stemmen
8 AntwoordenUser input on SoloLearn anoys me...
13 Stemmen
8 Antwoorden“Cin” input in C++
1 Stem
1 AntwoordTaking inputs in c/c++
3 Stemmen
4 AntwoordenBuffer
1 Stem
4 AntwoordenWhat happened?
0 Stemmen
7 AntwoordenPopulair vandaag
Decorators in python.
2 Votes
Coding for Cybersecurity
1 Votes
Need help
1 Votes
Salut tout le monde
2 Votes
Pointers in c#
1 Votes
Please click me
0 Votes