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 / 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 |
find largest element in array w/o using sorting techniques.
Write a program to produce the following output in c language? 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
What is an lvalue and an rvalue?
write a programme that inputs a number by user and gives its multiplication table.
What is null pointer in c?
C,c++, Java is all are structural oriented or procedure oriented language..?
How can I send mail from within a c program?
What are the various types of control structures in programming?
What does %d do?
program to find the ASCII value of a number
What is the value of y in the following code? x=7;y=0; if(x=6) y=7; else y=1;
Write a progarm to find the length of string using switch case?