Notification
No New notification
Learn to code with PrepInsta
Check PrepInsta Coding Blogs, Core CS, DSA etc
Never Miss an OffCampus Update
Get OffCampus Updates on Social Media from PrepInsta
Last non-zero digit in factorial in C++
Login/Signup to comment

























def fact(num):
if num==1:
return 1
else:
return num*fact(num-1)
out=fact(5)
while out!=0:
if out%10==0:
out=out/10
else:
print(int(out%10))
break
Hey, join our Discord Channel for technical queries