1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

help needed : poblem here is that program shows no error while compiling and does not

Discussion in 'C' started by psal_dun, May 2, 2011.

  1. psal_dun

    psal_dun New Member

    Joined:
    May 2, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    #include<stdio.h>
    #include<conio.h>
    #include<math.h>
    void main()
    {
    int ya,a=3,xa=97,q=353,po;
    po=pow(a,xa);
    ya=po % q;
    printf("ya=",ya);
    getch();
    }
     
  2. eriyer

    eriyer New Member

    Joined:
    Jan 22, 2011
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    0
    Re: help needed : poblem here is that program shows no error while compiling and does

    3 raised to power 97 will result in a very large value beyond the capacity of an integer variable and overflow will result - declare your variables as double
     
  3. raji.vunnam

    raji.vunnam New Member

    Joined:
    Jan 6, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    Re: help needed : poblem here is that program shows no error while compiling and does

    here overflow occurs ......bt its not a compile time error .........n .......
    u hav to use farmol arguments in printf then .......... u may eliminate that.....
     

Share This Page