Skip to content

Instantly share code, notes, and snippets.

@aligalehban
Created June 21, 2018 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aligalehban/259ab67289ddafa728fe6ae522ac6c3e to your computer and use it in GitHub Desktop.
Save aligalehban/259ab67289ddafa728fe6ae522ac6c3e to your computer and use it in GitHub Desktop.
Student GPA pass fail check and total avg calculation c++ source code - Www.Alighalehban.Com
#include <iostream>
using namespace std;
int main ()
{
int n = 10;
float nomre;
int shomarande=1;
int gabul=0,mardud=0;
int miyangin=0;
int miyanginkol=0 ;
while (n>0) {
cout << "Enter Student Number "<<shomarande<<" : ";
cin>>nomre;
--n;
++shomarande;
if (nomre>=10)
++gabul;
else
++mardud;
miyangin= nomre + miyangin;
}
cout<<"gabulin : "<<gabul<<endl;
cout<<"Mardudin : "<<mardud<<endl;
miyanginkol = miyangin / 10;
cout<<"miyangin kol :"<<miyanginkol<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment