This is a simple C++ program for beginners to find the grade
is a subject. This is a beginning level program and we only did it with IF else
condition to understand the condition statement.
Source Code
#include<iostream> #include<conio.h> #include<stdio.h> using namespace std; int main() { int marks; char ch; cout<<endl<<endl<<"*********** Find Grades ***********"<<endl<<endl; do{ cout<<"Enter marks : "; cin>>marks; // Here Is Enter your Marks if (marks>=80) // Check if your Marks is Greater or equal than 80 than u got A { cout<<"A"; } else if(marks>=70) // Check if your Marks is Greater or equal than 70 than u got B { cout<<"B"; } else if(marks>=60) // Check if your Marks is Greater or equal than 60 than u got C { cout<<"C"; } else if(marks>=50) // Check if your Marks is Greater or equal than 50 than u got D { cout<<"D"; } else // Check if your Marks is less or equal than 49 than u fail { cout<<"Fail"; } cout<<endl<<endl<<"Do you Want Continue : (Y/N)"<<endl<<endl; // If you want to exist Press N cin>>ch; cout<<endl; }while(ch=='y'); return 0; }
0 comments:
Post a Comment