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...

I have an array of 100 elements. Each element contains some
text. i want to:
append a star character to the end of every fifth element
remove every second character from every tenth element,
and…
add a line feed (ascii 10) after the 30th character of
every array element whose length is greater than 30
characters.

Answer Posted / ravi joshi

int process_str()
{
int i, j;
char *ptr[100] = {"some text here"};
int len = 100;

for(i = 0; i < len; i++)
{
if(!(i % 5))
{
// process fifth element
}
elseif(!(i % 10))
{
// process 10th element
}
elseif(!(i % 30))
{
// process 30th element
}
}
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the advantage of an array over individual variables?

1198


What is the difference between union and anonymous union?

1265


What is the difference between fread and fwrite function?

1054


Is it possible to execute code even after the program exits the main() function?

1297


What is time null in c?

1028


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

1060


can anyone suggest some site name..where i can get some good data structure puzzles???

2037


Why C language is a procedural language?

989


What is a pointer on a pointer in c programming language?

1102


What are the types of c language?

1003


Explain why C language is procedural?

1171


Is null always equal to 0(zero)?

1006


What is indirection in c?

1037


Is python a c language?

957


Explain what does it mean when a pointer is used in an if statement?

1025