answersLogoWhite

0


Best Answer

Yes

int main (void) {

puts ("if statement");

puts ("else statement");

return 0;

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is it possible to print both if statement and else statement?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can print both statement of if and else?

Simply print the whole source-code.


What is difference between IF THEN and IF THEN ELSE statement?

An if-then statement, or simply an if statement, checks if a stated condition is true. If the condition is true, then a block of code will then execute. Example: if number equals 3 print out "Number equals 3" An if-then-else statement, or simply an if-else statement, checks if a stated condition is true. If the condition is true, then a certain block of code will then execute. If the condition is false, then a different block of code will then execute. Example: if number equals 3 print out "Number equals 3" else print out "Number does not equal 3" For both if statements and if-else statements, there is only one stated condition. The difference between them is that an if statement will only cause something to happen if the condition is true. An if-else statement will execute a block of code whether the condition is true or false.


What must you place in if conditon to execute both if and else?

if ( fork() ) { print "hello"; } else { print "world"; }


Why does your if and else statement both executes?

That never happens, you misunderstood something.


How If and else run at a time?

The standard syntax is:if( conditional_expression )statement;[[else if( conditional_expression )statement;[else if...]]else statement;][] denotes optional components. Each statement may be a single statement, or may be multiple statements surrounded by braces {}.The if( conditional expression ) statement; is the only required component. In plain English, this reads: if the conditional expression is true, then execute the following statement, otherwise skip to the line following the statement.If the next line is an else statement, then the line reads: if the conditional expression is true, then execute the statement and skip over the else statement. But if the conditional expression is false, then skip over the statement and execute the else statement instead.if( conditional_expression )statement; // execute when conditional expression is trueelsestatement; // execute when conditional expression is falseThe statement following the else can be another ifstatement (a nested if):if( conditional_expression_1 )statement; // execute when conditional_expression_1 is true.else if( conditional_expression_2)statement; // execute when conditional_expression_1 is false and _2 is true.elsestatement; // execute when both _1 and _2 are both false.Note that if an else statement is used without a following if statement, it must appear after all other else if statements.


Syntax of nested if in c?

If(condition) { if-else statement; } else { if-else statement; }


What is the scope of variables declared in an if then else statement is false path?

Only the true path in the If...Then...Else statement


What is else if in C programming language?

Statements. Typical usage: if (<condition>) <statement>; else <statement>;


How can we find percentage's in QBASIC?

this is nested if statement cls input"enter percent age of marks:" ,x if x>=50 and x>=100 then print"first division" elseif x>=50 and x< 60 then print"second division" elseif x>=33 and x<50 then print"third division" else print"fail" endif


Which condition in if loop lets us to known that both printf statements after if and else will printin c?

I don't really get your point, it is unlikely that both then-statement and else-statement should be executed. I daresay it is impossible.Try me:printf ("before if\n");if (1) printf ("condition is true (non zero)\n");else printf ("condition is false (zero)\n");printf ("after if\n");


What is ladderized if else if conditional statement?

if(condition) { statements /* ... */ }


What is the similarity between 'if' statement ans 'switch' statement?

A Switch statement can be considered as a series of if. else if. else statements. whatever condition is satisfied, the code block would get executed. if (cond 1) { } else if (cond 2) { } else if (cond 3) { } ...... } else if (cond N) { } else { } switch { case 1: .... case 2: .... .... case N: ... default: ... } Difference: In the if else blocks, if one condition is satisfied, all other blocks are ignored In Switch blocks, unless you have break statements inside each condition block, the subsequent blocks would not be ignored.