answersLogoWhite

0

What is the format of if statement in c plus plus?

Updated: 8/18/2019
User Avatar

Wiki User

10y ago

Best Answer

Syntax:

if (expression)

statement;

[else

statement;]

The expression must evaluate to a boolean value, where zero is false and all non-zero values are true. The statement (including the optional else statement) may be simple or compound, and may include a nested if statement. When the expression evaluates true, the first statement is invoked. If an else statement is provided, it is only executed when the expression evaluates false. After the appropriate statement is invoked, execution passes to the statement that immediately follows the entire if statement.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the format of if statement in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which statement is not frequently used in C plus plus?

The goto statement.


What is the deffernce of the switch statement and the if statement in c plus plus?

If statement is single selection statement,whereas the switch statement is multiple selective.


Basic control structure available in c plus plus?

The basic control structure in C++ is the if statement.


A c plus plus statement that invokes a function is known as?

...a function call.


What is IEEE standard in c plus plus?

The format of floating-point numbers. On some platforms.


Which statement in C plus plus is used to implement a decision structure in its simplest form-that of choosing between two alternatives?

if (condition) statement else statement;


What is the function of visual c plus plus switch condition?

The switch / case statement.


What is the character used at the end of executable statements in C plus plus?

The semi-colon converts a C++ expression into a statement.


How can write the name in c plus plus language without using cout statement?

I believe, you can use C-function - printf().


How can you print your name in c or c plus plus with out using semi column?

You can not print your name in C without a semi colon because according to the rules of C every statement should end with a semi colon.In fact without the semi colon it fails to be a valid C statement.


When factoring a trinomial that is in the format Ax2 plus Bx plus C the number that is represented by Bshould be viewed as the?

The coefficient of x


Can you write plus at end of c statement?

No. That would be a syntax error. Only a right semicolon (;) can go at the end of a statement.