ਇਕ ਸਟਰਿੰਗ ਨੂੰ ਕਾਪੀ ਕਰਕੇ ਉਲਟਣ ਲਈ ਪ੍ਰੋਗਰਾਮ ਲਿਖੋ।

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

void main()
{
    char s1[20], s2[20];
   
    puts("Enter a string: ");
    gets(s2);
   
    strcpy(s1,s2);
    strrev(s1);
   
    printf("Reverse of %s is %s",s2,s1);
    getch();
}

Output:



Comments