strcmp for string matching

QUESTION

The task is to compare two strings. Make use of the strcmp() in string.h. Input can be of uppercase, lowercase or both.

ANSWER

#include <stdio.h>
#include<string.h>
//using namespace std;
int main()
{
  char str1[100], str2[100];
 scanf("%s", str1);
  //str1=tolower(str1)
 scanf("%s", str2);

if(strcmp(str1,str2)==0)
  printf("Entered strings are equal");
  else 
      printf("Entered strings are not equal");

	return 0;
}
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.