Skip to content

Instantly share code, notes, and snippets.

@bitwiser
Last active August 29, 2015 13:56
Show Gist options
  • Save bitwiser/9197433 to your computer and use it in GitHub Desktop.
Save bitwiser/9197433 to your computer and use it in GitHub Desktop.
#include<iostream>
using namespace std;
void getScore(int &a){
cout<<"Enter score(0-100): ";
cin>>a;
cout<<"You entered: "<<a<<endl;
}
void printGrade(int a){
if(a>=0 && a<=59){
cout<<"Grade F\n";
}else if(a>=60 && a<=69){
cout<<"Grade D\n";
}else if(a>=70 && a<=79){
cout<<"Grade C\n";
}else if(a>=80 && a<=89){
cout<<"Grade B\n";
}else if(a>=90 && a<=100){
cout<<"Grade A\n";
}
}
int main(){
int score;
getScore(score);
printGrade(score);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment