Question: QUESTION 1 Consider the following C main() function: #include #include #include int main( ) { char str1[16]= area 51 ; char str2[13] =

QUESTION 1

  1. Consider the following C main() function:

    #include

    #include

    #include

    int main( )

    {

    char str1[16]= " area 51 ";

    char str2[13] = " Hello World";

    char str3[21] = " Is this working?";

    char str4[10] = " ";

    leftJustify(str1);

    leftJustify(str2);

    leftJustify(str3);

    leftJustify(str4);

    printf("String:'%s' ", str1);

    printf("String:'%s' ", str2);

    printf("String:'%s' ", str3);

    printf("String:'%s' ", str4);

    return 0;

    }

    As part of this test, you are to write function leftJustify() used in the above C program. The leftJustify() function accepts a C string and removes all leading blank characters from the string. For the purpose of this test, a blank characters is .

    If you implement the function correctly, the output of the C program above should be exactly as follows:

    String:'area 51 '

    String:'Hello World'

    String:'Is this working?'

    String:'

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 Databases Questions!