Why this code skips the line number:-14 and not giving the chance to input the data from user??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why this code skips the line number:-14 and not giving the chance to input the data from user???

I couldn't find the sollution!!! https://code.sololearn.com/cwCgRyEEWFXu/?ref=app

26th Apr 2020, 11:10 AM
Amit singh
Amit singh - avatar
6 Answers
0
void setdata() { cout<<"Enter the name of product\n"; fflush(stdin); // <-- ###### do this. ######## getline(cin,name) cout<<"Enter the Stock of product\n"; cin>>stock; cout<<"Enter the price:-\n"; cin>>price;
26th Apr 2020, 11:29 AM
rodwynnejones
rodwynnejones - avatar
0
Still not working Output now:- Enter the total item of Store 1 Enter the name of product Enter the Stock of product https://code.dcoder.tech/files/code/5e9f38bb84064c3004e40aa1/medical-shope
26th Apr 2020, 11:38 AM
Amit singh
Amit singh - avatar
0
?? works fine in my IDE (code::blocks).
26th Apr 2020, 11:45 AM
rodwynnejones
rodwynnejones - avatar
0
Oooo great!!! At preasent i code on smartphone that might be a reason
26th Apr 2020, 11:46 AM
Amit singh
Amit singh - avatar
0
@Amit singh Are you trying to run it in code playground? If so...that might be reason.
26th Apr 2020, 12:16 PM
rodwynnejones
rodwynnejones - avatar
0
Okkk Thanks for replies you given!!!
26th Apr 2020, 12:18 PM
Amit singh
Amit singh - avatar