Ask 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.

+4
Answers (1)
  1. 25 November, 23:15
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers