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
How can I access an I o board directly?
If the size of int data type is two bytes, what is the range of signed int data type?
diff between exptected result and requirement?
What is difference between stdio h and conio h?
What are the advantage of c language?
What are the types of type qualifiers in c?
What is operator precedence?
What is type qualifiers?
Linked lists -- can you tell me how to check whether a linked list is circular?
What is a function in c?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
what is the basis for selection of arrays or pointers as data structure in a program
writ a program to compare using strcmp VIVA and viva with its output.
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What is the difference between far and near in c?