troubleshooting Question

C# Do / While Statement

Avatar of sneeri_c
sneeri_c asked on
C#
2 Comments1 Solution258 ViewsLast Modified:
I am trying to write a Do Statement that will loop until 1 of 2 variables meets the criteria of the while statement. So when either intWidth or intHeight drops below either MaxWidth or MaxHeight respectively the loop will end.

Right now when I run this, the loop continues until both intWidth and intHeight are below MaxWidth and MaxHeight.

                Do                
                {
                    intHeight = (int)Math.Round(MaxHeight * varRatio, 0);
                    intWidth = (int)Math.Round(MaxWidth * varRatio, 0);
                } while (intWidth > MaxWidth || intHeight > MaxHeight);

Any help would be great

Thanks

     
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros