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 |
Do you know the difference between malloc() and calloc() function?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
When a c file is executed there are many files that are automatically opened what are they files?
main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); }
write a program in c to read array check element is present or not?
write a c program for print your name .but,your name may be small letter mean print a capital letter or your name may be capital letter mean print a small letter .example \\enter ur name : sankar The name is: SANKAR (or) enter your name:SAnkar The name is:saNKAR
Explain indirection?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
What are identifiers in c?
what is the mean of c languages.
main() { char x; while(x=0;x<=255;x++) printf("\nAscii value %d Charater %c",x,x); }
What is #define?