void main()
    int i,n,j;
    printf("\n Please Give The Value of N:  ");
            printf("%d  ",j);
    system ("pause");
    return 0;

Inline Code Example Here

2 Years
Discussion Span
Last Post by faultybits

I don't mean to be rude, but I feel that I need to point somethings out. This is far from what a modern C++ program should look like. If I had to guess, you are using Turbo C++, which is severely outdated. Also the use of outdated header files like conio.h is strongly discouraged. I recommend you get a compiler which is up-to-date and portable, like g++ from the GNU Compiler Collection. Also if you want your program to be portable, you have to make sure you avoid using platform-dependant functions like the system() function. When you run the program from within the command line, you won't be needing any "pause" functions, because when the program terminates your command line will still be open and you can see the output. Consider reading the book C++ Primer (5th Edition) by Stanley B. Lippman. You will acquire good and modern C++ habits and you will be introduced to the C++ 11 standard. The C++ 11 standard is a big leap for C++ and it is important that you grasp it as soon as possible so that your programming tasks can be done in a simpler and more efficient manner, as well as a stepping stone for the recently released C++ 14 standard. Once you get comfortable with the changes in the C++ 11 standard you will have absolutely no trouble following the future implementations and changes in the C++ language.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.