More help please

This is a discussion on More help please within the C++ Programming forums, part of the General Programming Boards category; #include <iostream.h> #include <stdlib.h> #include <string.h> #include <conio.h> int main() { int pi; { cout << 1/2.545584412*8; system("pause"); } return ...

  1. #1
    Registered User marcusbankuti's Avatar
    Join Date
    Mar 2002
    Posts
    32

    More help please

    #include <iostream.h>
    #include <stdlib.h>
    #include <string.h>
    #include <conio.h>

    int main()
    {
    int pi;
    {
    cout << 1/2.545584412*8;
    system("pause");
    }
    return 0;
    }

    That is my new code. Now, it shows only 3.1427, how do I get it do display more digits? Also, when beside the equation, I take away the ;, and << /n;, the program does not run, and when it is <<"/n";, It does not work.

  2. #2
    Registered User marcusbankuti's Avatar
    Join Date
    Mar 2002
    Posts
    32
    Sorry, this was supposed to be a reply. I will repost it as a reply in the "My PI Program" thread.

    Moderator, please delete this.

  3. #3
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    what are you trying to do with this program? You have pi declared, but are doing nothing with it. Plus you got another set of braces inside the main function.

  4. #4
    Registered User marcusbankuti's Avatar
    Join Date
    Mar 2002
    Posts
    32
    I have pi declared because I forgot to get rid of it while trying to rid it of a bug. I want the program to display infinite digits it PI.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21