123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 

 
Program to compare two input strings.

--------------------------------------------------------------------------------



#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
char s1[80],s2[80];
int a,b;
int strcmp(char *s,char *t);
void main()
{
int c;
clrscr();
printf(" WELCOME TO THE PROGRAM SIR/MADAM

<BR>);
printf("Enter string 1 :- ");
gets(s1);
printf("Enter string 2 :- ");
gets(s2);
c=strcmp(s1,s2);
if (c==0)
printf("Strings are similar.");
else if (a>b)
{
printf("Strings are not similar.");
printf("
First string is lenthier than the second string.");
}
else if (b>a)
{
printf("Strings are not similar.");
printf("
First string is shorter than the second string.");
}
else
printf("
Strings are not similar though they are equal in length.");
printf("




HAVE A NICE DAY! BYE.");
getch();
}

int strcmp(char s[],char t[])
{
int i;
a=strlen(s1);
b=strlen(s2);
if (a>b)
{
for(i=0;*s!='
 

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved copyright 123ENG