c++ programming: how to display odd numbers and more...
By masskara19
@masskara19 (45)
Philippines
November 10, 2009 7:10pm CST
i need help as soon as possible. here are the programs i need to make for later's quiz:
1. a program that will display odd numbers from 1-100 using for loop and a separate program using do while loop.
2. a program that will input 5 integers and will output the lowest and highest number.
i need answers in 5 hours. thanks!!!
1 response
@sucahyo (103)
• Indonesia
11 Nov 09
You should get answer quicker if you submit this to knowbrainer or similar site.
I forget the syntax but it looks like this:
loop x from 1 to 100:
if (x mod 2) = 1 then print x
loop end.
x is 1
do while x bellow 100:
if (x mod 2) = 1 then print x
do while end.
for the second problem, I can't give it because I don't have c++ at hand. It usually solved with "array" and "sort method", if not mistaken it's called bubble sort. http://en.wikipedia.org/wiki/Bubble_sort