Tuesday, December 6, 2011

Write a C program to copy a String to one variable to another variable by library function

#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
 char a[25],b[25];
 clrscr();
 printf("Please Enter A String: ");
 gets(a);
 strcpy(b,a);
 printf("Your Entered string \"%s\"\nAfter copying string is \"%s\"",a,b);
 getch();
}

No comments:

Post a Comment