|
-
April 10th, 2010, 09:52 PM
#5
Re: No output for "smallest number"? Why?
 Originally Posted by SoloXX
Just made an adjustment in the IF statement of case B. Although I'm now getting output, it always spits out the FIRST number I input. Why is that? Basically, I just changed the operator from "<=" to ">"
The code above is the same except for the IF:
Code:
if(groupNbrs > temp_B)
{
temp_B = groupNbrs;
cout <<"The smallest number in the group is: " <<groupNbrs;
break;
}
Because that's still not what you want to do. You want to find the smallest number. Now you're looking for the biggest.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|