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
Templates permit to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until

Develop a Student class that has the following header file: #ifndef STUDENT_H #define STUDENT_H #include #include #include using namespace std; class Stu

An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Overtime pay equals the total overtime hours multiplied

#question:-program to counts tha no of occurances of the string in the nth padovan string

How to Create A Data File? A data file should be created before it can be processed. A stream-oriented data file is able to be created in two ways. One is to create the file st

What if I wish a local to "die" before the close} of the scope wherein it was created? Can I call a destructor on a local if I want to?


Project Description: We are seeking online invoice OCR solution. That will help us to automate accounts payable function. User should be able to use the offered pdf file or s

Write a C program to input five numbers and print them out on a new line e.g 5, 10, 15, 20, 25 displayed as   5   10   15   20   25 #include stdio.h   void main()   {

can you tell me what is c#