I am new to c++ language, and i am stucked with this que. my teacher told me to write a prog. that will calculate
(1)square-(3)square+(5)square-(7)square+(9)square.............so on using for loop can you help me.
OK, we can see that you have these two programs written, but what have you done about the current assignment?
BTW, three things to take note of. First, you should always declare main() as type int; while void main() is accepted by some older, non-standard compilers, it is not actually correct according to the C++ standard, and never has been acording to Bjarne Stroustrup. Second, in modern C++, the header should be <iostream>, not <iostream.h>; however, since it appears you are using the ancient Turbo C++ compiler, and probably don't have a choice in the matter, you can only do what you are doing for the time being. Third, you use the non-standard <conio.h> library, which is not part of the actual C++ language and is not supported by modern systems.