C Program to find the ASCII Value of All Character

C Program to find the ASCII Value of All Character

C program to find the ASCII value of all character; Through this tutorial, we will learn how to find the ascii value of all character.

Programs to find ASCII value of all Characters in C

  • C Program to find ASCII value of all Characters using For Loop
  • C Program to find ASCII value of all Characters using While Loop

C Program to find ASCII value of all Characters using For Loop

#include <stdio.h>

int main()
{
  int i;
  
  for(i=0;i<=255;i++)
   {
    printf("The ASCII value of %c = %d\n",i,i);
   }
  return 0;
}

C Program to find ASCII value of all Characters using While Loop

#include <stdio.h> 
#include <string.h> 

void main()
{
 int i = 0, sum = 0;
 char name[50];
 
 printf("\nPlease Enter any name You wish\n");
 scanf("%s", name);

 while(name[i]!='
#include <stdio.h> 
#include <string.h> 
void main()
{
int i = 0, sum = 0;
char name[50];
printf("\nPlease Enter any name You wish\n");
scanf("%s", name);
while(name[i]!='\0')
{
printf("The ASCII value of the Character %c = %d\n",
name [i], name [i]);
sum = sum + name [i];
i++;
}
printf("\nSum of all characters : %d ", sum);
}
') { printf("The ASCII value of the Character %c = %d\n", name [i], name [i]); sum = sum + name [i]; i++; } printf("\nSum of all characters : %d ", sum); }

The output of the above c program; as follows:

Please Enter any name You wish :- d

The ASCII value of the Character d = 100

Sum of all characters : 100 

Recommended C Programs

AuthorAdmin

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *