Post Test¶
Please answer the following problems to the best of your ability without any outside help. You can stop working on a problem after you worked on it for about five minutes without solving it.
Problems¶
Write the function char* upper_center(char* str)
to return the passed string str
with the middle character(s) in uppercase.
If
str
has an odd length, uppercase the middle character.If
str
has an even length, uppercase the middle two characters.If
str
has less than 3 characters then returnstr
.
Example Input |
Expected Output |
---|---|
|
|
|
|
|
|
Write a function int is_descending(int* nums)
to do the following.
Return
1
if the numbers in the listnums
are sorted in descending order.Otherwise return
0
.If the list
nums
has less than two numbers in it return1
.
Example Input |
Expected Output |
---|---|
|
|
|
|
|
|
Write the function int sum67(int* nums)
that takes a list of numbers and
returns the total of the numbers in the list except for all the
numbers whose position is between a 6 and 7 in the list (inclusive).
Example Input |
Expected Output |
---|---|
|
|
|
|
|
|
Write the function int isAlmostPalindrome(char* x)
that takes a string, x
, and returns
1
if x can be a palindrome after deleting at most one character from it,
and 0
otherwise. A string is a palindrome if the characters read the
same backwards as forwards.
Example Input |
Expected Output |
---|---|
|
|
|
|
|
|
Feedback¶
Q-5: Please provide feedback here. Please share any comments, problems, or suggestions.
What to do next¶
Click on the following link to go to the post survey: Post Test