Technologies such as cloud, fog, and edge computing offer exceptional solutions for many technical problems in the Internet of Things (IoT). Cloud computing offers enormous flexibility in terms of resource availability and demand. In this paper, the role of cloud, edge, and fog computing in IoT was discussed along with the emergence of numerous IoT smart scenarios which are difficult to implement. This research is important in guiding future network paradigms that require faster processing with less delay and disruption, and the advanced technologies in them can address the challenges of IoT. It also reviews cloud, fog, and edge computing and their relevance to the IoT.