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

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

Posted Date: 9/10/2012 7:48:14 AM | Location : United States







Related Discussions:- C program for function of copy one string in other string, Assignment Help, Ask Question on C program for function of copy one string in other string, Get Answer, Expert's Help, C program for function of copy one string in other string Discussions

Write discussion on C program for function of copy one string in other string
Your posts are moderated
Related Questions
C program to Print Fibonacci series upto n using recursion: int fibo(long int); void main() {                 long int a=0,n;                 printf ("how many term

How do one throw polymorphically?               A: Sometimes people write code such as: class MyExceptionBase { }; class MyExceptionDerived : public MyExceptionBase { };

Implement multiple stacks in a single dimensional array using c.

Problem : (a) Stacks can be implemented using arrays. Write down the following C or C++ function to (i) create a stack (ii) add an element to a stack (push). (b) Expl

New data members  New member functions  New constructors and destructor  New friends

one of the segments is showing compilation error...


Create a pseudocode in getting Calendar Quarter. The program should identify which quarter falls the given date. Note: Consider the date format DDMMYYYY.

I have to make a program that allow the user input 10 numbers between 10 and 100 and if the number input is the same than the last number, should appear an error message. I have th

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