0% found this document useful (0 votes)
8 views2 pages

CS Programming Techniques

Uploaded by

17adarao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

CS Programming Techniques

Uploaded by

17adarao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

•Sequence → Instructions run in order.

•Iteration → Repeating code (loops).

•Branching → Decisions (if/else).

Task:
Write a program that:
[Link] for a number.
[Link] even → print "Even number".
[Link] → print "Odd number".
[Link] 5 times using a loop.
•Recursion → Function calls itself.
•Iteration → Uses loops instead.
•Recursion is elegant but uses more memory.
Task:
•Write a recursive factorial function.
•Rewrite it using a loop.
•Compare: Which one is easier to understand?

You might also like