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

What is printend by the following program frangment? ( In both cases, ch is of type c

Discussion in 'C++' started by Albaniankool, Apr 20, 2007.

  1. Albaniankool

    Albaniankool New Member

    Joined:
    Apr 18, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    What is printend by the following program frangment? ( In both cases, ch is of type char.)


    ch = 'F' ;
    cout << ch << ' ' << int(ch); // Assume ASCII
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    Why dont you try and run the program and see what is the output and share with us.

    Also from the post above you have also posted the answer to your query. Just see where is the answer.
     
  3. Albaniankool

    Albaniankool New Member

    Joined:
    Apr 18, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    i don't have c++ program at home that y im asking.
     
  4. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    You can try out the online C++ Compiler as well to see the results.

    It should print the value of the character as F and then the ASCII of F i.e. 70
     
  5. Albaniankool

    Albaniankool New Member

    Joined:
    Apr 18, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    wats the site for it??
     
  6. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0

Share This Page