Solution of Assignment 7.
1) For Loop
Solution of Assignment 7.1
Example : For Loop (Using C Lang)
Solution of Assignment 7.1
2) While Loop
Solution of Assignment 7.1
Example: While Loop (Using C Lang)
Solution of Assignment 7.1
3) Continue
Solution of Assignment 7.1
Example Of Continue (Using C Lang)
Solution of Assignment 7.1
4) If-else
Solution of Assignment 7.1
Example of If-Else (Using C Lang)
Solution of Assignment 7.1
5) Swith
Solution of Assignment 7.1
Example of Switch (Using C Lang)
Solution of Assignment 7.1
Recursion:
Solution of Assignment 7.1
Flowchart Recursion:
Solution of Assignment 7.1
Example of Recursion:
Solution of Assignment 7.1
Binary Search Tree:
Solution of Assignment 7.1
Example: Due to large code size I’m not able to take the snap of code please
find below vpaste link, I have uploaded code on the vpaste
[Link]
Solution of Assignment 7.1
Closure:
Solution of Assignment 7.1
Write an implementation of getElementByld, which performs the same basic
task as that of actual getElementByld, (don't use shortcuts like queryselector)
def getElementByld(element_id, root=None):
if root is None:
root = [Link]
if [Link]("id") == element_id:
return root
for child in [Link]:
result = getElementByld(element_id, child)
if result is not None:
return result
return None
Solution of Assignment 7.1
Given a number x, find out if it is a prime number or not, use javascript and
find out the difference between Next prime number after X and X.
Solution:- [Link]