I think my argument is correct, but while limitless loops, outputting zero. Here is my code:
int currentMSD, currentNum = num; If (current> gt; = 0 & amp; amp; amp; current & lt; 100) {currentMSD = 10; } And if (current news: = 100 & amp; amp; amp; amp; & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp;; current & lt; 1000) {b1 = b * msd; B2 = Number 3 - B1; Num3 = b2; Switch (B) {Case 1: Cust & lt; & Lt; "One "; break; Case 2: Cotton and LT; & Lt; "two "; Cout & lt; & Lt; "Five "; break; Case 6: Cotton and LT; & Lt; "Six"; break; Case 9: Cout and LT; & Lt; "Nine"; break; Case 0: COAT & LT; & Lt; "Zero"; break; }} Cout & lt; & Lt; '\ N'; }
getMSD () function is faulty. Change it with this new one int getMSD (int num) {int currentMSD = 1, currentNum = num; If (current news: = 10 & amp; amp; amp; amp; & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; & amp; amp; amp;; current; & lt; 100) {currentMSD = 10; } And if (current news: = 100 & amp; amp; amp; amp; & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp;; current & lt; 1000) {currentMSD = 100; } And if (current> gt; = 1000 & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp;; current & lt; 10000) {currentMSD = 1000; } Return currentMSD; }
Comments
Post a Comment