A student will not be allowed to sit in exam if his/her attendance is less than 75%.
Take the following input from the user
Number of classes held
Number of classes attended.
And print:
percentage of class attended
Is the student is allowed to sit in exam or not?
#include<iostream>
using namespace std;
int main()
{
float classheld, classattend, percentage;
cout<<"enter your classess held: ";
cin>>classheld;
cout<<"enter your classess attend: ";
cin>>classattend;
percentage=(classattend/classheld)*100;
cout<<"your percentage is "<<percentage<<"%"<<endl;
if (percentage>=75)
cout<<"Your are eligible to sit in exams";
else
cout<<"You are not eligible to sit in exams";
}
Output:
Tags
c++