Answer:
I'm better at C++, but I'm pretty sure this it:
/*C - Program to compare two strings
character by character.*/
#include<stdio.h>
int main(){
char str1[]="Hello";
char str2[]="Hello";
int len1=0, len2=0;
int i,isSame=0;
//calculate lengths
i=0;
while(str1[i++]!='\0') len1++;
i=0;
while(str2[i++]!='\0') len2++;
if(len1!=len2){
printf("Strings are not same, lengths are different\\");
return -1;
}
isSame=1;
for(i=0;i<len1;i++){
if(str1[i]!=str2[i]){
isSame=0;
break;
}
}
if(isSame)
printf("Strings are same.\\");
else
printf("Strings are not same.\\");
return 0;
}