Sesiones de PyR
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 Voto
8 Respuestas6.1 c++
0 Votos
3 RespuestasInput and output
-3 Votos
5 RespuestasWhat is cin?
0 Votos
5 Respuestasc++ user input
0 Votos
2 Respuestasconsole input activation
0 Votos
8 Respuestas“Cin” input in C++
1 Voto
1 RespuestaTaking inputs in c/c++
3 Votos
4 RespuestasBuffer
1 Voto
4 RespuestasEn tendencia hoy
Detach thread exception
1 Votes
Qt timer timeout
0 Votes
Not video
0 Votes
Not image in the page
1 Votes
How to make a 2d game
0 Votes
Html
1 Votes