code for concatination of 2 strings with out using library
functions?
Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
void strrcat(char *,char *);
void main()
{
char a[50],b[50];
int i;
clrscr();
printf("enter the string 1 :");
gets(a);
printf("enter the string 2 :");
gets(b);
strrcat(a,b);
gets(a);
getch();
}
void strrcat(char *a , char *b)
{
for(int i=0;*a!='\0';i++,a++);
for(int j=0;*b!='\0';j++,i++,b++,a++)
*a=*b;
*a='\0';
}
thank u :)
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Differentiate between static and dynamic modeling.
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What is volatile keyword in c?
Where we use clrscr in c?
What are the uses of a pointer?
What is header file definition?
What is the role of && operator in a program code?
Do you have any idea about the use of "auto" keyword?
Write a program to swap two numbers without using third variable in c?
Explain what are header files and explain what are its uses in c programming?
What is a macro, and explain how do you use it?
Can math operations be performed on a void pointer?
How many main () function we can have in a project?
Differentiate between functions getch() and getche().