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
What are the 3 types of structures?
How many types of operators are there in c?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
Why is c called c?
Which header file is essential for using strcmp function?
Do you have any idea how to compare array with pointer in c?
Explain spaghetti programming?
Why is c so important?
Explain the difference between ++u and u++?
What is the deal on sprintf_s return value?
What is the difference between far and near ?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What is null pointer constant?
How do I get a null pointer in my programs?
What is the difference between typedef and #define?