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 page thrashing?

1090


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1837


Which are low level languages?

1105


why we wont use '&' sing in aceesing the string using scanf

2377


Can you return null in c?

1176


Is c# a good language?

1022


What is use of bit field?

1304


What are file streams?

1022


Explain how do you use a pointer to a function?

1117


What is a lvalue

1091


int far *near * p; means

3563


Define the scope of static variables.

1136


Explain what is page thrashing?

1108


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1289


What is the explanation for cyclic nature of data types in c?

1225