This blogger has been created for the purpose of education.
The owner of this blogger is Vikas Kumar Sharma who has worked hard in making this blog lo, only coding related topics are posted in this blog. Computer people who want to learn the language, follow this blog and post it to others
Monday, 13 September 2021
How to print ASCII code for given charactor by the user.
#include<stdio.h>intmain(){char arr[30];//declare the size of character arrayintcount=0;//declare a count variable//enter any name to get the ascii codesprintf("\nEnter the name to get the ASCII codes:");scanf("%s",&arr);//use while loop to sequentially iterate every character of the arraywhile(arr[count]!='\0'){//display the character name one by one printf("\n The ascii code of the character %c is %d",arr[count],arr[count]);count++;//increment one by one}return0;}
No comments:
Post a Comment