idastan97

CSCI151 L20 P2

Oct 18th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. _Bool areEqual(char str1[], char str2[]){
  4.     int i=0;
  5.     while (str1[i]!='\0' && str2[i]!='\0'){
  6.         if (str1[i]==str2[i]){
  7.             i++;
  8.         }
  9.         else
  10.             return 0;
  11.     }
  12.     if (str1[i]==str2[i])
  13.         return 1;
  14.     else
  15.         return 0;
  16. }
  17.  
  18. int main(void) {
  19.     printf("%i", areEqual("qwert", "qwerty"));
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment