Answers for "what is the correct syntax of a for loop?"

0

For Loop

for (int i = 0; i < 5; i++) {
  System.out.println(i);
}
Posted by: Guest on February-12-2022
5

for loop

# example of forloop and return through factorial
def fact(m):# function factorial
    a=1
    for e in range(1,m+1):#we will be using for loop
        a*=e
    return a#return function
x= 5 # put the value in x eg, 5
d=fact(x)
print(d)

output:
120==5*4*3*2*1
-------------------------------------------------------------------------------
Posted by: Guest on November-28-2021

Code answers related to "what is the correct syntax of a for loop?"

Python Answers by Framework

Browse Popular Code Answers by Language