What is the difference between for-loop and if-else statements | SoloLearn: Learn to code for FREE!

0

What is the difference between for-loop and if-else statements

c++

2/23/2017 3:07:03 PM

MASTER OF COMPUTER

2 Answers

New Answer

+7

For-Loop is an looping statement and If-Else is Conditional statement.

+1

They're two completely different things. When you use a for loop, the code inside it executes until the condition of the loop is true. When you use if-else, if the condition is true you run the code inside the "if", otherwise you run the code inside the "else", but only once.