LearnFrenzy
Sign in Take a free test

C Library Functions · Exercise 4 of 4

C Library Functions Library Function Programs

  • 8 questions
  • Page 1 of 1
  • Answers explained
0Attempted
0Correct
0Wrong
Directions

Programs built from standard library functions. Write each one yourself first, then open the solution – every solution was compiled and run, and the output shown is the real output.

Question 1 Easy

Find the roots of ax² + bx + c = 0 for three equations, covering two real roots, one repeated root and complex roots.

Question page & discussion
Question 2 Medium

For a list of test scores, print the mean, the median (sort with qsort) and the population standard deviation (sqrt).

Question page & discussion
Question 3 Hard

Look up words in a sorted array of word–meaning pairs using bsearch and strcmp, reporting words that are not in the dictionary.

Question page & discussion
Question 4 Easy

Split a sentence into words with strtok (spaces and punctuation as delimiters), count them and print the longest word.

Question page & discussion
Question 5 Medium

Using struct tm and mktime, find the number of days from 26 January 2026 to 15 August 2026 and the weekday of the second date.

Question page & discussion
Question 6 Easy

Encrypt a message by shifting letters by 3 (keeping case and leaving other characters alone), then decrypt it again.

Question page & discussion
Question 7 Medium

Sort an array of names alphabetically, ignoring upper/lower case, with qsort and a comparator built on tolower.

Question page & discussion
Question 8 Hard

Remove every repeated occurrence of a character from a string in place (keeping the first), shifting the rest left with memmove and searching with strchr.

Question page & discussion
All exercises doneBack to C Library FunctionsRevise the concepts or pick another topic

Ready to test your Programming?

Timed online tests with instant scores and explanations.

Search LearnFrenzy

Esc

Quick links