/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that shows the outcome of a comparison
of its two strings.*/
#include <stdio.h>
#include <string.h>

int main() {
    char s1[] = "abcdefghijkl";
    char s2[] = "abcdefkl";
    int outcome;
    int l1,l2;
    int len;
    
    len = (l1 = strlen(s1)) < (l2 = strlen(s2)) ? l1:l2;
    outcome = strncmp(s1,s2,len);
    if(! outcome) printf("equal\n");
    else if(outcome < 0) printf("first less than second\n");
    else printf("first greater than second\n");
}
