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 |
How do we select the big element or any other operation from array which is read dynamically. user need to give the elements only no need to mention the size.
char ch="{'H','I',0};printf("%s",ch);what is output
1. main() { printf("%d",printf("HelloSoft")); } Output?
Can the sizeof operator be used to tell the size of an array passed to a function?
What is 2 d array in c?
write a programme that inputs a number by user and gives its multiplication table.
hello friends what do u mean by BUS ERROR i got this error while i am doing my program in DATA STRUCTURES
Write a program to print prime nums from 1-20 using c programing?
Do you know what are bitwise shift operators in c programming?
Write a program that his output 1 12 123
# define x=1+4; main() { int x; printf("%d%d",x/2,x/4); }
Explain how can I open a file so that other programs can update it at the same time?