Program to illustrates strcmp( ) function


#include <iostream.h>
#include <conio.h>
#include <string.h>          
void main( )
{
    char s1[] = "Merry";
    char s2[] = "Herry";
    int i, j, k;
    i = strcmp(s1,"Merry");
    j = strcmp(s2, "Herry");
    k = strcmp(s1,s2);
    cout<<"\n"<<i<<"\t"<<j<<"\t"<<k;
    getch( );
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|