answersLogoWhite

0

#include<stdio.h>

void main()

{

int a=10,b=15;

clrscr();

if(a>b)

printf("%d is the large number",a);

else

printf("%d is the large number",b);

getch();

}

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra
More answers

There are a bunch and this should be expanded. I am currently tired and don't want to write them all and check my work to ensure the syntax is correct.

Basic conditional statements include...

if, for, do, while, and case (switch) statements.

User Avatar

Wiki User

15y ago
User Avatar

The same as in MS visual C, GCC and any other version of C.

The conditional statement has two forms:

if( expression ) statement

If the expression evaluates to nonzero, then the statement is executed, otherwise it is ignored.

if( expression ) statement elsestatement

If the expression evaluates to nonzero, then the first statement is executed, otherwise the second statement is executed.

In either form, the statements may be a single command, or may be multiple commands enclosed within braces {}. The statements may also be if statements themselves.

User Avatar

Wiki User

12y ago
User Avatar

Any statement that executes as the result of a conditional expression being evaluated true is a conditional statement.

if(<conditional_expression>)

// conditional statements go here

else if(< conditional_expression >)

...// conditional statements go here

else

...// conditional statements go here

switch(conditional_expression)

{

case(condition_1): // conditional statements go here; break;

case(condition_n): // conditional statements go here; break;

default: // conditional statements go here

}

while(condition_expression){

// conditional statements go here

}

do{

// conditional statements go here

}while(conditional_expression);

User Avatar

Wiki User

12y ago
User Avatar

The ternary operator (?:) is the conditional operator. It is ternary because it is the only operator that has three operands. They are:

conditional_expression ? true_expression: false_expression

The conditional_expression must be a Boolean expression evaluating true or false. If the expression evaluates true, the true_expression is evaluated, otherwise the false_expression is evaluated.

Note that unlike an if() statement, the conditional operator can be used as an expression in its own right:

void foo (unsigned n) {

for (unsigned i=0; i

}

In this example, the expression (i=n-1) ? "" : ", "evaluates to the string ", " (the false expression) for all i

foo (10); // output: "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"

User Avatar

Wiki User

8y ago
User Avatar

#include

int main()

{

int a,b;

printf ("Enter a number:\n");

scanf("%d",&a);

a==b;

printf("%d is equal to b",b);

return 0;

}

User Avatar

Wiki User

12y ago
User Avatar

if, else, for, while

User Avatar

Wiki User

16y ago
User Avatar

rerhe

User Avatar

Wiki User

12y ago
User Avatar

Add your answer:

Earn +20 pts
Q: How do you use the conditional statement of turbo c?
Write your answer...
Submit
Still have questions?
magnify glass
imp