C program to copy string using strcpy()-(simple example program)

C program

C PROGRAM


C program to copy string using strcpy()


#include <stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
  char s1[30]="mani";
  char s2[30]="gandan";
  clrscr();
  strcpy(s1,s2);
  printf("%s",s1);
  return 0;
  }


OUTPUT :

gandan

Process finished.

 

 


No comments:

Post a Comment




Copyright Ⓒ 2022 | Mechpedia | All Right Reserved.