Ask Question
7 December, 06:52

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.

+5
Answers (1)
  1. 7 December, 09:39
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers