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

Assignment Help:

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

 


Related Discussions:- C program for compare two strings

String, what is a string?

what is a string?

C++ programming, give a program to accept and print 2_D Array

give a program to accept and print 2_D Array

C and Data structure, Implement multiple stacks in a single dimensional arr...

Implement multiple stacks in a single dimensional array using c.

Padovan string, #question:-program to counts tha no of occurances of the st...

#question:-program to counts tha no of occurances of the string in the nth padovan string

Program to define simulation method, This problem familiarizes you with usi...

This problem familiarizes you with using random numbers in C++. The program is to compute a good approximation of π using a simulation method called "Monte Carlo". The following fi

Hotel booking, Construct a console program to manage the booking of a Hotel...

Construct a console program to manage the booking of a Hotel room.

Types of linked list with the help of diagrams, Problem: (a) Describe ...

Problem: (a) Describe a linked list. (b) Explain the three different types of linked list with the help of diagrams. (c) Give two advantages and two disadvantages o

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd