#include <stdio.h>
#include <conio.h>
#include <string.h>
int main()
{
char a[100], b[100];
printf(" Enter the first string: ");
gets(a);
printf(" Enter the second string: ");
gets(b);
if( strcmp ( a , b ) == 0 )
printf(" Entered strings are equal.\n ");
else
printf(" Entered strings are not equal.\n ");
getch();
return 0;
}
OUTPUT:
Enter the first string team
Enter the second string team
Entered strings are equal.
Sample C Program To Print The Reverse Of A String.
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
char arr[100];
printf(" Enter a string to reverse\n ");
gets(arr);
strrev(arr);
printf(" Reverse of entered string is \n %s \n ", arr);
getch();
return 0;
}
OUTPUT:
Enter a string to reverse
violet
Reverse of entered string is
teloiv
ALSO READ:
-- Program to accept a string and print it by using the while loop.
-- Program to accept a string in upper case and print it in lower case.
-- Program to accept a string in any case and print it by another case.
-- Program to accept a string and print each word in new line.
-- Program to accept a string and count no of capital letters, no. of small letters and no. of special characters.
-- Program to accept a string and find the length of the given string by using functions.
-- Program to accept a string and print the reverse of the given string.
-- Program to accept a string and check whether the given string is palindrome or not.
-- Program to accept two string and compare the strings are equal or not.
-- Program To Find Out The No. Of Times A Character Is Present In The String.
-- Program To Accept A String & Find Out Whether This Character Is Present In The String.
-- Program To Accept A String & Display Number Of Each Vowels.
-- Program To Accept A String & Display Number Of Vowels.
-- Program To Accept A String & Display Vowels.
-- Program To Accept Two Strings & Display Combination Of Two Strings.
-- Program To Accept Two Strings & Display The Largest String.
-- Program To Accept A String & Display It's Alternate Characters In Reverse.
-- Program To Accept A String & Display It's Substring.
-- Program To Accept A String & Display Alternate Characters In Either Case.
-- Program To Accept A String & Display Its Alternate Characters.
-- Program To Accept A String & Display In Reverse.
-- Program To Accept A String & Display It.
-- Program On Strings Into Array Of Pointers.
-- Program To Concatenate Two Strings.
-- Program To Compare Two Strings.
... Back To C++ Programs Index
... Back To C++ FAQ's Index
... Back To C Programs Index
... Back To C FAQ's Index
... Back To HR Interview Index
Really It is the best site to get succeeded in interview
ReplyDeleteThanks,
Karthik
8123429214