Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is ambagious result in C? explain with an example.

2551


Is it valid to address one element beyond the end of an array?

1121


What is the difference between the = symbol and == symbol?

1054


What are the __date__ and __time__ preprocessor commands?

1040


How can you call a function, given its name as a string?

1099


What are the properties of union in c?

995


What are the loops in c?

943


What are qualifiers and modifiers c?

940


What is the best way to comment out a section of code that contains comments?

1263


How do you determine the length of a string value that was stored in a variable?

1081


Explain 'far' and 'near' pointers in c.

1082


Explain what is wrong in this statement?

1068


How do you generate random numbers in C?

1146


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2234


What are the string functions? List some string functions available in c.

949