//Print ASCII value difference of two strings
#include <stdio.h>
#include<string.h>
#include<math.h>
#define limit 100
void main(){
   char a,b;
  int  p=0,count=0;
   char str[10],str1[10];
   printf("ENTER YOUR FIRST STRING =\n");
   scanf("%s",&str[0]);
    printf("ENTER YOUR SECOND STRING =\n");
   scanf("%s",&str1[0]);
   p=strlen(str);
  printf("YOUR STRING IS=%s\n",str);
  printf("YOUR STRING IS=%s\n",str1);
  
  for(int i=0;i<p;i++){
      if(str[i]!=str1[i]){
          count++;
          a=str[i];
          b=str1[i];
          printf("the value of a=%d\n",a);
           printf("the value of b=%d\n",b);
           break;
      }
  }
  if(count==1){
      printf("THE STRING ARE NOT EQUAL\n");
  }
  else{
      printf("STRING ARE EQUAL\n");
      
  }
  printf("THE DIFFERENCE BETWEEN ASCII VALUE =%d\n",(a-b));
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: