Engineers can use a recursion to opposite for-while statements. Recursion is the process of repeating items in a self-similar way.
The computation of Fibonacci numbers is a great example for understanding the recursion (the most simple and trivial example).
public int fibonacci(int n) {
if (n <= 1) return n;
else return fibonacci(n-1) + fibonacci(n-2);
}
But recursion in most popular programming languages has some disadvantages: (a) it's slow on big iterations and (b) uses a lot of memory for the stack of execution.
So, yes it's possible to write a for loop with only if-else statements.