iostream.h is ancient and has been replaced with iostream, conio.h is non standard and not necessary at all here, clearing the screen is not what a console program is expected to do, and main has to return an int; it's not legal for it to be of type void.
its working for me...
u can use int main(void)
and return 0....nd this is also an ancient thing.....i using it when i was 20..nw i am 22...i just make it simple for learner.... :p
I'm not saying it won't "work", I'm saying it's wrong to tell beginners to use them. The iostream.h is outdated, void main() is illegal (and although some compilers implement it as an extension, there's nothing "complicated" about returning an int), and also notice that foo() and foo(void) mean the exact same thing in C++. The foo(void) syntax is only there because of C compatibility (in C, those have different meanings).
I also don't see usingnamespace std; anywhere in that code which could make your "cin" "cout" commands cause an error.
EDIT: Does your code even run arun thakur? Declaring an integer "i" in the for loop on line 7 DOES NOT mean it exists in scope for the following loops. You need to redeclare the variable or else put it in the right scope.
Stuff like this is one of the main reasons we ask people NOT to use Dev-C++.
@filipe: ??? Then what declares\sets up the input\output streams? I'm not trying to troll you it's annoying me a little that I can't find this header file anywhere to take apart. I'll probably grab it off of Bloodshed's site later.
hmmm.....long discussion huh....
guys i use turbo c 3.0 Ver.... nd i write dat code at my own...yesterday in 15 minutes....nd also execute it successfully....
i don't use....any other compiler....bcoz i am not comfortable with them....basically i em java programmer....
and @ Mr. Computer geek ....in c we does't need to redeclare the things....its not java...
i made dis simple program to define the logic....for stated problem...so just stop noising on syntaxes :p.............
It does not matter if the code works for you, it is pre standard C++and will not work for most of the people learning C++ with a modern (standard compliant) compiler. Showing 'the logic' only works if the reader can understand the code, you would have been better of using pseudo code to express the logic than clouding the issue with 'old' C++.