How to print ASCII Code of character values | C Language Practice | IndianTechnoEra - IndianTechnoEra
Latest update Android YouTube

How to print ASCII Code of character values | C Language Practice | IndianTechnoEra

How to print ASCII Code of character values | C Language Practice | it2edu, c language
Admin

 

How to print ASCII Code of character values | C Language Practice | IndianTechnoEra 


Here we will see that how can we print all the ASCII Codes of characters. We'll use simple c language and we will find that with using very easy steps to use for loop.

Steps:

  1. Including header and main functions.
  2. Taking a variable.
  3. Using for loop
  4. Output to print with %c for character value and %d will be that integer value.



Code :

// To print ASCII code of characters //
#include<stdio.h>
int main(){
int i;
for (i=0;i<=255; i++){
printf("\nThe ASCII code of character %c is integer %d.",i,i);
}
return 0;
}


Output:




 

Post a Comment

Feel free to ask your query...
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.