Code:
 #include<iostream.h>
 #include<conio.h>
 int main()
 {
 clrscr();
 int grade,total=0;
 float avg,a=1;
 char z,y,n;
 cout<<"Enter the grade of the student = ";
 cin>>grade;
 do
 {
 cout<<"\nDo you want to enter another grade? (y/n) - ";
 cin>>z;
 if ( z == y )
 {
 cout<<"\nEnter the grade of the student = ";
 cin>>grade;
 }
 if ( z == n )
 {
 cout<<"\nAverage of the student = "<<avg<<endl;
 getch ();
 return 0;
 }
 total=total+grade;
 avg=total/a;
 a++;
 }while ( a == a );
 cout<<"\nAverage of the student = "<<avg<<endl;
 getch ();
 return 0;
 }