Step-by-step explanation:
Following are the Algorithm of the program:
Step-1: Start.
Step-2: Define function 'sum_of_odd(num)'.
Step-3: Check, If num < 1
Then, return 0.
Otherwise, else
Then, return (2 * n - 1) + sum_odds(n - 1) .
Step-4: Call the function.
Step-5: Stop.