This document contains 14 programs demonstrating various string manipulation functions in C programming such as printf, gets, strlen, strcpy, strncpy, strcmp, strupr, strcat, strrev. Each program is accompanied by its output. The programs are organized by Vinay Arora of Thapar University to teach students how to use basic string handling functions in C.
18. Program - 9
#include<stdio.h>
#include<conio.h> getch();
void main()
{ }
char str1[20], str2[20];
int result;
clrscr();
printf("Enter 1st stringn");
gets(str1);
printf("Enter 2nd stringn");
gets(str2);
printf("n1st String is --->t%s",str1);
printf("n2nd String is --->t%s",str2);
result=strcmp(str1,str2);
//In case of match result will be ZERO otherwise NON ZERO
printf("nnResult after Comparing is %d",result);
Vinay Arora
CSED