Code not working! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Code not working!

So i made this code #include <iostream> using namespace std; int main() { int a; int b; cout << "please give login: "; cin >> a; cout << "\n\nplease give password: "; cin >> b; return 0; } And what i get is please give login: (something) please give password: Process returned 0 (0x0) execution time : 8.771 s Press any key to continue. Well i said to ask the user to input the seccond variable yet it doesn't work. Anybody know what's wrong?

18th Jul 2016, 11:09 PM
Bartosz Pikutin
Bartosz Pikutin - avatar
5 Answers
+ 1
as far as i can see, there is no error in your Code. the Program only does what you told it to do. After your cin >> b; call there is no Code left to get rid of. So your Program calls return 0 what means "i'm done. no Errors. I close this.
18th Jul 2016, 11:50 PM
Steven
Steven - avatar
+ 1
#include<iostream.h>
19th Feb 2017, 11:50 AM
Devaashish Sharma
0
please input additional code like Cout the user input in a and b. let's see. it will execute well
19th Jul 2016, 4:13 AM
Issah Mudasir
Issah Mudasir - avatar
0
ok thanks Steven and thanks Issah! I'll try that out soon ;)
19th Jul 2016, 5:55 AM
Bartosz Pikutin
Bartosz Pikutin - avatar
0
Did you enter the password in the form of numbers?? Also provide input for both the statements in the same input area if you are using the compiler of this app. And while entering the input make sure to separate them with a space. Hope it works. Try adding a cout statement to see if it works.
20th Jul 2016, 3:54 AM
Sudatt Shakyamuni (Jay)
Sudatt Shakyamuni (Jay) - avatar