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 |
When the macros gets expanded?
Describe the header file and its usage in c programming?
WHAT IS HIGH LEVEL LANGUAGE?
main() { char p[] = "hello world!"; p = "vector"; printf("%s",p); }
2 Answers Vector, Vector India,
Difference Between embedded software and soft ware?
Reverse the bit order in a single macro. eg. i/p = 10010101 --> o/p = 10101001
Difference between C and Embedded C?
how will you write a program on linked lists using JAVA programming???????????
What is getch c?
Is there a way to compare two structure variables?
while running a program, i got the msg that press return key to exit.what that mean in C as there are no such options as far i know.
What is output redirection?