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

5 answers

Did you make a typo with "var" vs "intvar"??

Assuming you made a typo the output is "54321".

2007-02-05 17:41:56 · answer #1 · answered by x 4 · 0 0

already they have given the answer.

Output would be 54321.

Why?

since the declaration of the variable is static though, we have a decrement var-- and which makes the program to display it 54321.

2007-02-05 18:11:24 · answer #2 · answered by Vinothbabu 3 · 0 0

intvar must be separated
semicolon must be added for print command
Then output will be
5
4
3
2
1

Here is C++ version of the program:

#include
using namespace std;
int main()
{ static int var=5;
cout <<"\n" << var--;
if (var) main();
cout < system("pause");
}

2007-02-05 21:01:24 · answer #3 · answered by iyiogrenci 6 · 0 0

output: 54321

2007-02-05 20:45:06 · answer #4 · answered by Kishore 1 · 0 0

I concur...
54321

2007-02-05 17:57:27 · answer #5 · answered by KnightSpot 2 · 0 0

fedest.com, questions and answers