STRING IN C.

 #include <stdio.h>

#include <string.h>

int main()
{
    char string1[] = "Aatifa";
    char string2[] = "Mugheer";
    char string3[67];
   
    printf("The length of s1 is %d\n", strlen(string1));
    printf("The length of s2 is %d\n", strlen(string2));
    printf("The reversed string s1 is: ");
    puts(strrev(string1));
    printf("The reversed string s2 is: ");
    puts(strrev(string2));
    strcpy(string3, strcat(string1, string2));
    puts(string3);
     printf("The strcmp for string1, string2 returned %d", strcmp(string1,string2));


    return 0;
}

OUTPUT:
The length of s1 is 6 The length of s2 is 7 The reversed string s1 is: afitaA The reversed string s2 is: reehguM afitaAreehguM The strcmp for string1, string2 returned -1

Comments

Post a Comment

Popular posts from this blog

C Program using continue statement

C program of WHILE Loop

NULL Pointer in C.

C Program using DO WHILE loop

C Program using SWITCH statement

New Animated Login or signup page made by HTML, CSS and JavaScript.

C Program to print multiplication table of any number.

C Language Travel Agency Manager Exercise.

STRUCTURE IN C PROGRAMMING.