DO while loop: use char type variable to control : char « Data Types « C++ Tutorial






#include <iostream>   
using namespace std;   
  
int main(){   
   long dividend, divisor;   
   char ch;   
  
   do{
      cout << "Enter dividend: "; cin >> dividend;   
      cout << "Enter divisor: ";  cin >> divisor;   
      cout << "Quotient is " << dividend / divisor;   
      cout << ", remainder is " << dividend % divisor;   
  
      cout << "\nDo another? (y/n): ";  //do it again?   
      cin >> ch;   
   }while( ch != 'n' );
   return 0;   
}








2.19.char
2.19.1.char and unsigned char
2.19.2.Write Charset To File
2.19.3.DO while loop: use char type variable to control
2.19.4.Using a nested if with char type