Question

Differentiate between the following with the help of suitable example for each :
a. Co-routines and subroutines
b. Co-routines and threads

30 Nov 2023
Answer :
Word Count : 580

a. Co-routines and Subroutines:

Subroutines:
A subroutine, also known as a function or method in programming, is a block of code designed to perform a specific task. It is a self-contained unit of code that can be called from other parts of the program, and it usually takes parameters and returns a value. Subroutines are used to break down a program into smaller, more manageable pieces, promoting code reusability and modularity.

Example in C:
```c
#include <stdio.h>

// Subroutine to calculate the square of a number
int square(int num) {
  _________ _________ ______ __________ ____ ______ ____ __________ _________ _____ ________.
_______ ________ ___ __________ _________ _________ _______ _________ ______ _____ _____ ____.
__________ _________ ___ _____ _____.
__________ _________ ________ ________ __________ ______ ________.
______ ____ ________ __________ _______ __________ _____ ______ _____.
_______ ____ ________ _____ ______ _________ ____.
_________ ______ ______ ____ __________ _________ ________ _______.
_______ ______ ________ ______ _______ _______ __________ ____ ________ _________ ________ ______.
__________ _____ _________ ________ _______.
_______ ___ __________ ______ ______ ______ ___ ___ ____ ________ ______ ____.
_______ ________ _______ __________ _______ _________ ________ _____ _____ ___ __________ ________.
___ ______ _______ ______ ___.
_______ _____ __________ __________ ________ ________ ____ ___.
_______ _________ ____ ______ _______ ___.
_________ _______ ____ _______ ____ _______ _____ _____ __________ ____.
____ ______ ______ _______ _________ ___ _______.
________ __________ _________ _______ ____ __________ _______ __________.
_________ ____ ________ ____ _______ _______ _____ ______.
____ _____ _______ ________ _________ _____ _______ _____ _______ _______ _______ ____.
___ ______ _____ _________ ______ ________.
_______ ____ _______ _____ _____ _____ ___ _____.
________ _____ ______ _________ ________.
___ ___ __________ ______ _______ _________ ____.
________ ________ _________ _______ _______ ________ ______.
_________ _________ ___ ______ __________ ______ _____ _________ __________ ________ ___.
_______ _________ ___ ___ ________ ____ ___ ________ ___ _____ __________ _________.
__________ _________ _______ _______ ___ __________ ___.
_______ ______ ______ ________ ______ ____ ______ ___ ____ __________ __________ _______.
___ _________ ______ ____ _________ ______ _________ ___ ___ __________ ________ _______.
________ ______ ___ ______ ___ ___ _________.
_____ ______ ________ _________ _______ _______ __________ _____ ________ __________ ________ __________.
__________ _________ _______ _____ __________ ___ _______ ___ _______ _______ _________ ______.
________ _____ ________ __________ ___ ___ _______ ____.
_____ ____ ____ _____ ________ ____ ___ _______.
_______ ______ ___ __________ ____ _________ __________ _____ ____.
____ ______ _______ __________ ______ _________ _______.
_____ _______ _______ ______ _______.
________ _______ ___ ___ ___ ________ _________.
__________ ___ _______ ______ ________ _____ ____ __________.
______ ________ ______ ________ __________ ______ ___ _____ ___ ____ ___.
_________ _________ ________ _____ ___ ____.
________ _________ _________ _____ ________ ____ _______ __________ ____ _____ _____.
_____ ______ ___ ___ ____ ________ _________ ___.
______ __________ _______ ________ _______ _______ _______ _________ ________ _________ ____ _____.
__________ ________ ________ _________ ____ _______ _______ _____ _______.
__________ ____ ________ ______ _______ ________ __________.
_______ ____ ______ __________ _________.
_________ ________ ________ ________ __________ _____ _______ _________ _________ ___ ____ _____.
____ _____ ___ ____ _______ ______ __________ ___ _________ _________ _________ ____.
___ ___ __________ ________ _____ __________ ____ ___.
____ ______ ____ ________ _______ __________ _______ _____ __________ _________ ___.
______ _______ ________ ___ _____ ____ ___ __________ _________ __________ ____ ________.
_________ __________ ___ _____ ___ ___ _________.
_________ ____ __________ _______ _______ _______ ________ ___ ______.
_________ ________ __________ ________ __________ ___.
_________ __________ ___ ____.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Differentiate between the following with the help of suitable example
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→