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
Program is to define a class as teacher: Program is to define a class as teacher and collect information about them by using classes and object class teacher   {   pr

By pressing ‘6’ (i.e. key’6’ one time) on the keypad, the mobile shows ‘m’ on display screen in write text message area .

need to create c++ classes to store all pascal types in compiler design.

how to define the structures

switch statement

Program is to store marks and name, roll no in a file: class stud   {     int rno;     char name[20];     int m1,m2,m3;     public:                 void acce

finds the average for all assignments for an individual student float getAverageForStudent(float scores[20][10], int student, int numAssignments) {  }  // finds the average for

write a program to solve e^x


Illustrate the Function Definition? The C code that explains what a function does is called the function definition. A function definition has the following form Type fun