Computer Science, asked by Umangchawla2009, 3 months ago

Why do we use conditions in Programming?​

Answers

Answered by DURGHA2007
1

Explanation:

They make it possible to test a variable against a value/compare a variable with another variable and make the program act in one way if the condition is met, and another if it isn't. ... A program that has conditional statements is called a Conditional Program, and the process is known as Conditional Programming

HOPE IT HELPS YOU....HAVE A GREAT DAY AHEAD....

Answered by qadrimohammadi696
1

Answer:

Introduction

Conditional statements check whether a programmer-specified Boolean condition is true or false. They make it possible to test a variable against a value/compare a variable with another variable and make the program act in one way if the condition is met, and another if it isn’t. They make the program very powerful and be able to be used for a vast variety of purposes, from creating simple calculators to controlling robots. A program that has conditional statements is called a Conditional Program, and the process is known as Conditional Programming.

For example, if a bulb is not working, you first check whether the switch is ON or OFF. If the switch is OFF you turn on the bulb, but if the switch is ON and bulb is not working, you replace the bulb or check connection. You act according to the situation or condition.

Similar questions