Explore BrainMass
Share

Explore BrainMass

    Internal Representation of Characters in C/C++

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Examine this code snippet and explain why it will work or why not it will not?

    char a;
    for(a = 'a';a < 'm';a++)
    printf("%cn");

    © BrainMass Inc. brainmass.com October 9, 2019, 6:54 pm ad1c9bdddf
    https://brainmass.com/computer-science/c/internal-representation-of-characters-in-c-c-101712

    Solution Preview

    The snippet produces the following output.
    a
    b
    c
    d
    e
    f
    g
    h
    i
    j
    k
    l

    This works ...

    Solution Summary

    Illustrates with an example. why a C/C++ statement involving a char variable is evaluated differently.

    $2.19