Skip to content
doubtly

2 answers

Answer: if (condition) statement; or, for several statements, if (condition) { statements; }

if (condition)
{
    statement-block;   /* runs only if condition is true */
}
next-statement;        /* always runs */

The condition is evaluated first. If it is true (non-zero), the statement block is executed; if it is false (zero), the block is skipped and control goes to the next statement after the if. The braces can be left out when there is only one statement.

Example:

if (marks >= 35)
    printf("Pass");

"Pass" is printed only when marks is 35 or more; otherwise nothing is printed.

Doubtly AI · 24 Oct 2026 AI-verified · Oct 2026 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.