233k views
1 vote
What is an “if” statement used for in a program?

User Neuromouse
by
8.1k points

1 Answer

3 votes
An if statement is a programming conditional statement that, if proved true, performs a function or displays information. ... In the example above, if the value of X were equal to any number less than 10, the program would print, or display, "Hello John" on the console when the script is run.
User Zhihar
by
7.9k points

No related questions found