Ask Question
3 November, 13:59

Write a program to print all the ASCII values and their equivalent characters using a while loop.

the ASCII values vary from 0 to 255.

+3
Answers (1)
  1. 3 November, 15:28
    0
    I am going to write a C program. The program is in the explanation. You use a simple while loop controled by a counter (don't forget to initialize nor increment the counter). Inside the while loop, you printf the ASCII value as a %d and the equivalent character as a %c.

    Explanation:

    #include

    int main () {

    int i = 0;

    /*While loop*/

    while (i < 256) {

    printf ("ASCII value: %d/n", i);

    printf ("ASCII character: %c/n", (char) i);

    i++;

    }

    return 0;

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a program to print all the ASCII values and their equivalent characters using a while loop. the ASCII values vary from 0 to 255. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers