144. Program to copy source string to destination string.
#include<stdio.h>
char sr[10],ds[10],i;
void main()
{
printf("Enter a string : ");
scanf("%s",sr);
for(i=0;sr[i];i++)
{
ds[i]=sr[i];
}
ds[i]=sr[i];
printf("%s",ds);
}
#include<stdio.h>
char sr[10],ds[10],i;
void main()
{
printf("Enter a string : ");
scanf("%s",sr);
for(i=0;sr[i];i++)
{
ds[i]=sr[i];
}
ds[i]=sr[i];
printf("%s",ds);
}
Comments
Post a Comment