Get Off-Campus Placement Jobs Info !!!
Programs asked in Mettl Coding Round
Click To Practce List of Programs asked in Nagarro !!!

Program Discussion :: Strings

Home > Programs > Strings

8 / 59

Write a function to implement strncpy using recursion.



int main()
    char s1[100],s2[100];
    int n;
    printf("Enter the string: ");
    printf("Enter the no. of characters to be copied: ");
    printf("String 1: %s ",s1);
    printf("String 2 after performing strncpy(): %s",strncpy(s2,s1,n));
    return 0;

Asked In :: Global Edge

Post Your Answer Here:


Post Your Reply Here: