C program for compare two strings , C/C++ Programming

void main()

{

          char n[100],n1[100];

          int i,j;

          clrscr();

          printf("ENTER THE FIRST STRING: ");

          scanf("%s",n);

          printf("ENTER THE SECOND STRING: ");

          scanf("%s",n1);

          for(i=0,j=0;n[i]!='\0';i++)

          {

                   if(n[i]!=n1[i])

                   j=1;

          }

          if(j==0)

          printf("THE TWO STRING ARE EQUAL");

          else

          printf("THE TWO STRING ARE NOT EQUAL");

          getch();

}

 


OUTPUT :

ENTER THE 1 STRING: KAMLESH

ENTER THE 2 STRING: KAMLESH

 

THE TWO STRING ARE EQUAL

 

Posted Date: 9/10/2012 2:59:53 AM | Location : United States







Related Discussions:- C program for compare two strings , Assignment Help, Ask Question on C program for compare two strings , Get Answer, Expert's Help, C program for compare two strings Discussions

Write discussion on C program for compare two strings
Your posts are moderated
Related Questions
Problem Statement: You have to write a C program to develop a Car Parking Management System for a busy commercial area. The system will record the car plate number, date and time w

•Flow Chart and Pseudocode of Add module - Hotel booking - Signup for new membership Delete module - Hotel reservation cancellation - Change of reservation

#question. write a program number to alphabet in c++..

##question.A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string co   program in jav


I need vsti program Project Description: Knowledge of vsti programs, and music is a plus, ex: nexus I will input the sounds I just need the interface built Skills required

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Within software languages we have the ability to store information in mail boxes i.e. memory slots which are given names to represent the box. The naming rules are governed by the

how is it made

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b