write a program to copy a string without using a string?
Answer Posted / balaji ganesh
#include<stdio.h>
#include<string.h>
void main()
{
char a[50],b[50];
int i,n=0;
clrscr();
printf("enter a string:");
while((a[n]=getchar())!='\n')
{
b[n]=a[n++];
}
for(i=0;i<n;i++)
printf("%c",b[i]);
getch();
}
Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
can anyone please tell about the nested interrupts?
When should you use a type cast?
Can you mix old-style and new-style function syntax?
What is difference between %d and %i in c?
What are control structures? What are the different types?
What is difference between structure and union with example?
What are the different data types in C?
What is c language in simple words?
What is the difference between strcpy() and memcpy() function in c programming?
What does typeof return in c?
How many types of operator or there in c?
What is the difference between fread and fwrite function?
What is the use of c language in real life?
Define Array of pointers.
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above