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 is ambagious result in C? explain with an example.
Is it valid to address one element beyond the end of an array?
What is the difference between the = symbol and == symbol?
What are the __date__ and __time__ preprocessor commands?
How can you call a function, given its name as a string?
What are the properties of union in c?
What are the loops in c?
What are qualifiers and modifiers c?
What is the best way to comment out a section of code that contains comments?
How do you determine the length of a string value that was stored in a variable?
Explain 'far' and 'near' pointers in c.
Explain what is wrong in this statement?
How do you generate random numbers in C?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
What are the string functions? List some string functions available in c.