This is the full of code, can you tells me that what should me need to change for proper execution
it takes the input correctly but close cmd window before showing the result.Code:#include <iostream.h> using namespace std; main() { //Initialization of veriables char grad; //to take inputs of grades A or B int tnos, ga, gb; tnos = 1; //Total number of students ga = 0; //Total number of grad 'a' gb = 0; //Total number of grad 'b' do { cout<<"Enter the Grade of Student "<<tnos<<" :"; //to take inputs cin>>grad; if(grad=='a') //to decide while the grade is 'a', 'b' or anyother { ga=ga+1; //counter to count 'a' grades tnos=tnos+1; } else if(grad=='b') { gb=gb+1; //counter to count 'b' grades tnos=tnos+1; } else { cout<<"Please enter only grads A or B:"; } } while(tnos<=10); //maximum inputs to take or total number of students whos grades are required { cout<<"Total A grades are : "<<ga; cout<<"Total B grades are : "<<gb; } //Now on the basis of total number of grades we shell show the status of a class. if(ga<=2) cout<<"Your class is Poor..!"; else if(ga<=7) cout<<"Your class is Good..!"; else cout<<"Your class is Brilliant..!"; }




Reply With Quote
