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.



I have an array of 100 elements. Each element contains some text. i want to: append a star chara..

Answer / 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

More C Interview Questions

What will be the outcome of the following conditional statement if the value of variable s is 10?

0 Answers  


Explain what is the heap?

0 Answers  


What is the use of gets and puts?

0 Answers  


In which layer of the network datastructure format change is done

0 Answers   Honeywell,


Write a program to find given number is even or odd without using any control statement.

2 Answers  


which is an algorithm for sorting in a growing Lexicographic order

0 Answers  


Is main a keyword in c?

0 Answers  


Write a program that his output 1 12 123

0 Answers  


What is the difference between %d and %i?

0 Answers  


What do you mean by Recursion Function?

0 Answers   Hexaware,


what is void pointer?

2 Answers  


Explain how can I write functions that take a variable number of arguments?

0 Answers  


Categories