+ 1

What are unused variables and how can you correct it?

It goes like this: double fine=0.0;The fine is somehow unused. https://code.sololearn.com/cP445c9D0L7F/?ref=app

9th Mar 2020, 2:03 PM
melvin mwango
melvin mwango - avatar
1 Resposta
+ 1
You declared variable as "Fine" but using like "fine". Both are different, Capital F, small f. In If statement, why you putting condition in between " " ? It becomes a string not condition. if(0<overspeed&overspeed<=5) is correct way, But not if("0<overspeed&overspeed<=5") cin>>overspeed; //take input before output... If it is variable. cout<<overspeed<<endl; //remove "" and it is not end1, it is endl means end line. cin>>fine; cout<<fine<<endl; if (0<overspeed&overspeed<=5) Same for all others..
9th Mar 2020, 2:24 PM
Jayakrishna 🇮🇳