I am new to C++ . Is there any way that I can use the "for...else" method? I came from a python background there is a method called for...else loop
for n in range(2, 10):
for x in range(2, n):
if n % x == 0:
print( n, 'equals', x, '*', n/x)
break
else:
# loop fell through without finding a factor
print(n, 'is a prime number')
Is there any process in c++ like the "for...else" loop in python?