Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

String Compare Using String Functions in C

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

void main()
{
    char a[10],b[10];
    int i,n=0,n1=0;
    clrscr();
    printf("\nenter first string:");
    scanf("%s",a);
    printf("\nenter second string:");
    scanf("%s",b);
    if(strcmp(a,b)==0)
        printf("\nboth string are equal");
    else if(strcmp(a,b)<0)
        printf("\n1st string is smaller");
    else
        printf("2nd string is smaller");
    getch();
}