how to copy a string without using c function

Answer Posted / valli

main()
{
char s[20],s2[20];
printf("enter the string");
scanf(" %[^\n]",s);
for(i=0;s[i];i++)
s[i]=s2[i];
s2[i]='\0';
printf("%s",s2);
}

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

1500


Explain the term printf() and scanf() used in c language?

600


How to implement a packet in C

2401


What is the difference between text and binary modes?

650


Why is #define used?

794






What is indirection? How many levels of pointers can you have?

665


How do I send escape sequences to control a terminal or other device?

618


what is the difference between 123 and 0123 in c?

729


Where local variables are stored in c?

561


Once I have used freopen, how can I get the original stdout (or stdin) back?

631


What is array in c with example?

620


Tell me when is a void pointer used?

651


explain what is fifo?

636


i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none

650


What language is c written?

580