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
Passing and Returning Objects Objects can be passed to a function and returned back just like normal variables. When an object is passed by content, the compiler makes another

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

#q•Design and code a new function that accepts as parameters the gross pay by value and the federal tax, state tax, local tax, SS tax, and net Pay by reference. Calculate the taxes

write a c program chat illustrates the creation of child process using fork system call. One process finds sum of even series and other process finds sum of odd series.

Ask question #write statement that assign random integer to the varaible n in the (100

The procedure +, * and list take arbitrary numbers of arguments. One way to define such a procedure is to use define with dotted-tail notation. In a procedure definition, a paramet

Unlike C++, other programming languages have associative arrays that allow array indices to be strings instead of just integers. You are to create a template class, SVector, that i

Write a function that computes f(x) for a quadratic polynomial in x, such as the one in assignment 3. Use the function to plot f(x) from -10 to +10.

Implementing Operator Functions The general format of the Operator function is: return_type operator op ( argument list );   Where op is the symbol for the operator be

I want to take 1.1 as input but when I am declaring it as float the output is given as 1.1000000