turning a while --> do while loop
I have this:

    #include <iostream>
    
    using namespace std;
    
    int main()
    {
      char ch, max = 0;
      int n = 0;
      cout << "Enter number of characters! :";
      cin >> n;
      cout << "Enter the number";
      while (n>0)
      {
          cin >> ch;
          if(max<ch)
          max = ch;
          n=n-1;
    
      }
      cout << "max is : " << max;

trying to turn it into a do while..heres what I have:

    int main()
    {
    char ch, max = 0;
    int n = 0;
    cout << "enter character";
    cin >> n;
    cout << "enter two";
    cin >> ch;
    do
          (max<ch);
    
    while
    (max = ch);
    (n>0);
    n= n - 1;
    
    
          cout << "max is : " << max;

}

thanks!!


turning a while --> do while loop
===

I have this:

    #include <iostream>
    
    using namespace std;
    
    int main()
    {
      char ch, max = 0;
      int n = 0;
      cout << "Enter number of characters! :";
      cin >> n;
      cout << "Enter the number";
      while (n>0)
      {
          cin >> ch;
          if(max<ch)
          max = ch;
          n=n-1;
    
      }
      cout << "max is : " << max;

trying to turn it into a do while..heres what I have:

    int main()
    {
    char ch, max = 0;
    int n = 0;
    cout << "enter character";
    cin >> n;
    cout << "enter two";
    cin >> ch;
    do
          (max<ch);
    
    while
    (max = ch);
    (n>0);
    n= n - 1;
    
    
          cout << "max is : " << max;

}

thanks!!

