Can we consider the loops as a function?? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Can we consider the loops as a function??

As we know that () represents a function either a predefined function or a user defined function. So can we say that the for loop and while loop are also predefined functions????

2nd Nov 2016, 6:16 PM
RAM KUMAR
RAM KUMAR - avatar
2 Réponses
+ 6
nope, loops are control structures, just like conditionals. You pass parameters to functions, whereas loops take a condition.
2nd Nov 2016, 6:18 PM
James Flanders
+ 2
no,loops are not use as functions.loops are used to access multiple entries of data member.
2nd Nov 2016, 6:26 PM
Umar Safdar
Umar Safdar - avatar