English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

The full question:
Using a while loop, write a program that will print out the numbers from 53 to 48, backwards, all on one line. Print the messages "Starting" and "Done" before and after the line of numbers.

Sample output :
Starting
53 52 51 50 49 48
Done

2007-03-05 16:00:05 · 4 answers · asked by Facilitate 1 in Computers & Internet Programming & Design

In C++ code

2007-03-05 16:11:04 · update #1

4 answers

ummm, pretty simple to do. did you at least TRY to write it?

main()
{
int number = 53;
char ch[10];
cout<<"Starting"< while (number > 47)
{
itoa(number, ch, 10);
cout< number--;
}
cout< }

2007-03-06 01:08:41 · answer #1 · answered by justme 7 · 0 0

# written in Python
print "Starting"
for i in range(53, 47, -1): print i,
print
print "Done"

# damn, that was easy.

2007-03-05 16:06:31 · answer #2 · answered by poorcocoboiboi 6 · 0 2

in PHP

echo "Starting ";
for ($i = 53; $i <= 48; $i--) echo $i . " ";
echo "Done";
?>

2007-03-05 16:10:24 · answer #3 · answered by josh.weissbock 3 · 0 1

int a=54;


for( int b=a; b>48; b--)
{
cout< }

2007-03-05 21:22:08 · answer #4 · answered by Jenna 3 · 0 1

fedest.com, questions and answers