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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.