Question
QUESTION 1 Consider the following C main() function: #include #include #include int main( ) { char str1[16]= area 51 ; char str2[13] =
QUESTION 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started