This program displays decimal,hexadecimal & character equivalents




int main(void)
{
    int i = 0;

    for(i = 0; i < 255; i++)
        printf("Dec-%3d hex-%02x Char-%c\n", i, i, i);
    return 0;
}

Recommended Answers

All 2 Replies

Two gold stars. What's next?

Printing a char which can be of any value is sometimes problematic... printing all 255 of them, without actually using some ifs to fix it, will always be problematic.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.