Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please comment each statement in the program below #include <stdio.h> #include <

ID: 3651369 • Letter: P

Question

Please comment each statement in the program below
#include <stdio.h>
#include <string.h>

void ReverseArray(char* apples);


int main()
{
int i;

char tires[80];

strcpy(tires,"Whitewalls are best");

printf ("Tires is located at %p ",tires);


for (i=0; i<10; i++)
{
printf ("Tires[%d] = %c at %p ",i,tires[i], &tires[i]);
//printf ("Tires[%d] = %d at %p ",i,tires[i], &tires[i]);
//printf ("Tires[%d] = %c at %p ",i,*(tires+i), tires+i);
}


ReverseArray(tires);

printf("The return string is: %s ",tires);

return 0;
}

void ReverseArray(char* apples)
{
int i,j, length=0;
char temp;

length = strlen(apples);
printf("found length =%d ",length);

for(i=0, j=length-1; i<j; i++, j--)
{
temp = apples[i];
apples[i] = apples[j];
apples[j] = temp;
// printf("i=%d ",i);
}

return;
}

Please comment each statement in the program below

Explanation / Answer

#include //standard in/output lib #include //string lib void ReverseArray(char* apples);//prototype for fxn int main()//main { int i;//declare integer char tires[80];//declare char array of length 80 strcpy(tires,"Whitewalls are best");//copy string into tires variable printf ("Tires is located at %p ",tires);//print to console, where %p is address for (i=0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote