C program for function of copy one string in other string, C/C++ Programming

Assignment Help:

C Program for FUNCTION OF COPY ONE STRING IN OTHER STRING

#include stdio.h>

#include conio.h>

int copy(char a[],char b[]);

void main()

{

          char a[100],b[100];

          int i;

          clrscr();

          printf("ENTER THE FIRST STRING: ");

          gets(a);

          printf("ENTER THE SECOND STRING: ");

          gets(b);

          copy(a,b);

 

          getch();                                              

}

int copy(char a[],char b[])

{

          int i;

          for(i=0;a[i]!='\0';i++)

          {

                   a[i]=b[i];

          }

          a[i]='\0';

          printf("THE FIRST STRING IS COPY AND PUT INTO B= %s",a);

}

 

OUTPUT :

ENTER THE 1 STRING: KAMLESH

ENTER THE 2 STRING: MENGAR

 

THE FIRST IS COPY AND PUT INTO B = MENGAR


Related Discussions:- C program for function of copy one string in other string

Create a minimum of fifteen functions, Purpose For this assignment you ...

Purpose For this assignment you will need to create either a function list or a record series for a CRCRS. Instructions Note: Complete only one of the two assignment op

How to write Bernoulli''s principle, compose a C program to solve the equat...

compose a C program to solve the equation z2=(p1/Pg)+(v1^2/2g)+z1 p1=100kpa,v1=2m/s z1=3m P=1000kg/m^3 define g=9.81

Oops, write a c++ program to find the prime numbers

write a c++ program to find the prime numbers

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Example of pointers, #include "stdafx.h" #include iostream using name...

#include "stdafx.h" #include iostream using namespace std; int _tmain(int argc, _TCHAR* argv[]) {             int NumbHold[5];             int * ptrNumb;

Write a program to illustrate array of structures, Write a program to illus...

Write a program to illustrate array of structures? struct customer { int id; char name[15]; }; struct customer c[100]; . In the above instance, the array of Structures is

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd