30.7k views
4 votes
. In an if/else statement, the if part executes its statement or block if the expression

is __________, and the else part executes its statement or block if the expression is

__________.

User Patlatus
by
7.5k points

1 Answer

3 votes

Answer:

The answer to this question can be given as

true, false.

Step-by-step explanation:

As we know that If-else statement is a part of the all programming language. If block always execute true value. The syntax of if-else statement can be given as

Syntax:

if()

{

//code for condition true.

}

else

{

//code for condition false.

}

Example:

#include <stdio.h>

int main()

{

int a=10; //declaring integer variable a.

if(a==10) //check condition

{

/*

starting of if block in( ) we pass condition for check for example

(a==10) where a is integer a variable.

*/

printf("value match.."); //true part

}

else

{

printf("value not match.."); //false part

}

return 0;

}

In the above example, a is an integer variable we assign value to it. and check the value by if-else statement. if the value is true it executes value match or print else part that is value not match.

So the answer to this question is true, false.

User Fahad Ashraf
by
8.0k points