Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- double marks;
- cin>>marks;
- //approach-1
- if(marks>=80) {
- cout<<"A\n";
- }
- if(marks>=60 && marks<80) {
- cout<<"B\n";
- }
- if(marks>=40 && marks<60) {
- cout<<"C\n";
- }
- if(marks<40) {
- cout<<"F\n";
- }
- //approach-2
- if(marks>=80) {
- cout<<"A\n";
- }
- else if(marks>=60) {
- cout<<"B\n";
- }
- else if(marks>=40) {
- cout<<"C\n";
- }
- else {
- cout<<"F\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement