String Comparison

#include <stdio.h>
#include <string.h>

int main() {
    // String comparison
    char str1[] = "apple";
    char str2[] = "orange";

    if (strcmp(str1, str2) == 0) {
        printf("The strings are equal.\n");
    } else {
        printf("The strings are not equal.\n");
    }

    return 0;
}
chevron_left
chevron_right

Leave a comment

Your email address will not be published. Required fields are marked *

Comment
Name
Email
Website