Output of program

Discussion in 'C' started by Stuart Dickson, Sep 4, 2010.

  1. Stuart Dickson

    Stuart Dickson New Member

    Joined:
    Sep 4, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    I executed this program and output was "C". Can someone expain why it was output and not "C++". Thanks.

    Code:
    int main(){
     float a = 0.7;
    if(a < 0.7)
         printf("c");
    else
        printf("c++");
    }
     
  2. go4expert

    go4expert Moderator

    Joined:
    Aug 3, 2004
    Messages:
    306
    Likes Received:
    9
    Trophy Points:
    0
    It is because of precision.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice