For Loop
for (int i = 0; i < 5; i++) {
System.out.println(i);
}
For Loop
for (int i = 0; i < 5; i++) {
System.out.println(i);
}
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
-------------------------------------------------------------------------------
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us