C program to copy string from one variable to another variable

C Program
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    char Str1[10],Str2[10];
    printf("Enter any word: ");
    scanf("%s",&Str1);
    printf("Copying word...\n");
    strcpy(Str2,Str1);
    printf("The copied word is %s",Str2);
    return 0;

}



No comments:

Post a Comment