Question: COMMENT THE CODE #include fundamentals.h void fundamentals() { printf(*** Start of Indexing String Demo *** ); char buffer1[81]; char num_input[11]; int position; while (TRUE) {

COMMENT THE CODE

#include "fundamentals.h"

void fundamentals()

{

printf("*** Start of Indexing String Demo *** ");

char buffer1[81];

char num_input[11];

int position;

while (TRUE)

{

printf("(q=quit) Enter a String: ");

gets(buffer1);

if (strcmp(buffer1, "q") == 0)

{

break;

}

while (TRUE)

{

printf("(q=quit) Char at index (0-%d): ", strlen(buffer1) - 1);

gets(num_input);

if (strcmp(num_input, "q") == 0)

{

break;

}

position = atoi(num_input);

if (position >= strlen(buffer1))

{

printf("Wrong position... type again, please ");

break;

}

printf("Position of Char %d is \'%c\' ", position, buffer1[position]);

}

}

printf("*** End of Indexing Strings Demo *** ");

printf("*** Start of Measuring Strings Demo *** ");

char buffer2[80];

while (TRUE)

{

printf("Type a string (q - quit): ");

gets(buffer2);

if (strcmp(buffer2, "q") == 0)

{

break;

}

printf("The length is %lu ", strlen(buffer2));

}

printf("*** End of Measuring Strings Demo *** ");

}

int main(void)

{

fundamentals();

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!