Print ASCII value difference of two strings - C

Write a program to read two strings and compare using strcmp() function and print a message accordingly. Also print difference between their ASCII values.

Solution:

#include <stdio.h>
#include <string.h>
int main()
{
    char a[100], b[100];
    int z;
    printf("Enter First String: ");
    gets(a);
    printf("\nEnter Second String: ");
    gets(b);
    if (strcmp(a,b) == 0)
        printf("\nStrings are Equal.\n");
    else
        printf("\nStrings are Not Equal.\n");
    z=strcmp(a,b); //It find the difference between their ASCII values
    printf("\nDifference Between ASCII value = %d",z);
    return 0;
}


Output:

difference two strings

difference two strings

difference two strings