+ 2
Why I can't run my code at If and else condition?
Pls help me why my code can't run in if and else condition? I can't upgrade my level because of this.
24 Answers
+ 2
That is in Conditionals and Loops Sections I can progress more pls help me maybe program have problems
+ 1
This is simple, change your data types from double to int. That's it. The code you provided will work with decimal numbers but you set the data types to double. It will work but not matched the criteria! That's why.
When the user inputs a decimal number for points, the program will check if the points are greater than or equal to 90. If they are, it will output "Pass"; otherwise, it will output "Fail". You should be very careful while selecting data types. You know try to debug your own program in different perspectives, it will increase your patience level and cognitive reasoning!
#include <iostream>
using namespace std;
int main() {
int points;
cin >> points;
//your code goes here
if(points>=90){
cout<<"Pass";
}
else{
cout<<"Fail";
}
return 0;
}
Happy Coding ☺️
+ 1
The logic for the program to display "Pass" if points are 90 or above, and "Fail" otherwise. It works here in Code Playground. Take a look⤵️
https://sololearn.com/compiler-playground/ces96ns8e1ew/?ref=app
+ 1
Not a pro
0
Can you please attached code here that we can see your efforts and resolve the issue.
0
#include <iostream>
using namespace std;
int main() {
double points;
cin >> points;
//your code goes here
if(points>=90){
cout<<"Pass";
}
else{
cout<<"Fail";
}
return 0;
}
0
Thx for explain 🙏🙏🙏
0
I try already it still the same
0
Can't run
0
#include <iostream>
using namespace std;
int main() {
int points;
cin >> points;
//your code goes here
if (points>=90)
{cout<<"Pass";
}
else{
cout<<"Fail";
}
return 0;
}
0
May I know where you try this? Is that code coach challange?
0
No that is my case study
0
If I can't run this code I will not progress my level more
0
How to do
0
Still I don't start the C++ course. Wait for a while bro. Let me start that! I will get u, soon.
0
I try this code on both my phone and my laptop still no working
0
In If conditional and Loops you will see
0
After finished Basic
0
I wrote the same you why still can run and upgrade
0
I need to upgrade more level but stuck in this code can't run and upgrade more