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

Arrays within a class, A r r a y s w i t h i n a c l a s s:...

A r r a y s w i t h i n a c l a s s: I t i s j u s t d ecl a r i n g o r c on s t ru c ti n g a d e r i v e d t

Explain syntax rules for writing a destructor function, Syntax rules for wr...

Syntax rules for writing a destructor function Its name is the similar as that of the class to which it belongs, except that the first character of the name is the symbol t

Copy constructor and an overloaded assignment operator, What is the differe...

What is the difference among a copy constructor and an overloaded assignment operator? Ans) A copy constructor constructs a latest object by using the content of the argument

What is a command line argument and what is its use, Question 1) What are ...

Question 1) What are the commonly used input/output functions in C? Question 2) What is the difference between function declaration and function definition? Write a recursive

Mr. D. Mclean, A Network of routers have been configured for the ...

A Network of routers have been configured for the purposes of handling data traffic within your company. You would like to have an application that does a network

C program, what will be the c program for ideal gas equation.

what will be the c program for ideal gas equation.

Jewel polishing, Byteland county is very famous for luminous jewels. Lumino...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Reverse digit function, how can i write reverse digit function like writing...

how can i write reverse digit function like writing 1234 and printing 4321

Working a homework programming assignment in C++, I am working on a program...

I am working on a program that allows a player to play a game against the computer. In this game the player can only chose to draw 1, 2, or 3 toothpicks. How do I make restrictions

Area under curve, Write a program to find the area under the curve y = f(x)...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

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