Write a C++ program which will print a message "You Pass" if a student's average is 60 or higher and print a message "You Fail" otherwise. The highest average a student can achieve is 100. Use if_elseif_else statements to code this program
#include <iostream> using namespace std; int main(){ float score; cout<<"Enter average score: "; cin>>score; if(score>=0 && score<=100){ if(score >= 60){ cout<<"You Pass"<<endl; } else{ cout<<"You Fail"<<endl; } } else{ cout<<"Invalid score. Score should be in between 0 to 100"<<endl; } return 0; }
Get Answers For Free
Most questions answered within 1 hours.