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

My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of Tutsmake.com. I like writing tutorials and tips that can help other developers. I share tutorials of 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 from a starting stage. As well as demo example.

Leave a Reply

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