Challenge: Sleep in a Multithread Function Call

Complete this hands-on exercise to test your knowledge.

Problem statement

Implement the fthread() function used in a C++ program to manage threads. The function should take an integer n as input and perform some operations on it, including sleeping for 100 * n milliseconds and printing some output.


An integer n where 0 < n <= 10.


The output should be a string containing the thread number and the current iteration number, formatted as follows: t{n}: {i}.

Get hands-on with 1200+ tech skills courses.