Обсуждения
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 голос
8 ответовIs it possible to make my code run without having to press Enter on my IDE? For example: if I'm making a calculator and I want the calculations to be made as soon as I press "=" after typing the numbers and the operator?
Say I wanted to add two numbers: can it calculate automatically as soon as I write "2+3=" without having to press Enter?
0 голосов
5 ответовCould someone please help me with this..
Write code for an applet class that contains three labels First Number, Second Number, and Sum; three text fields for displaying the values of First Number, Second Number, and Sum, respectively; a button labeled Add. The applet allows the user to enter two integer values and displays the Sum if the Add button is clicked.
Write a html page to run and display the applet appropriately
0 голосов
4 ответовAnyone to help out on this codes?
-1 голос
1 ответАктуальное сегодня
Javascript
3 Votes
Fitting
0 Votes
Why text takes time to load
1 Votes
Digital currency
1 Votes