What is different between while and if statement in c++??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is different between while and if statement in c++???

C++

22nd Jul 2019, 3:54 PM
Mohammad Jafer
Mohammad Jafer - avatar
2 Answers
+ 3
Mohammad Jafer The while loop, loops until false. The if condition is activated if the condition is met. more info here: http://www.cplusplus.com/doc/tutorial/control/
22nd Jul 2019, 3:57 PM
Manual
Manual - avatar
+ 3
While is a looping statement.It will execute the statement inside it until the condition becomes false. If is a decision making statement. It will execute the statement inside it once ,after the decision is made based on the condition.
22nd Jul 2019, 5:57 PM
Sowmya