Define the conditional operator in c language, C/C++ Programming

Assignment Help:

Define the Conditional Operator in c language?

The Simple conditional operator can be carried out with the conditional operators (? And :). An expression that makes use of the conditional operator is called as a conditional expression. The conditional operators,? And: are sometimes called as ternary operators since they take three operands. This universal form is

Expression 1 ? expression 2 : expression 3

This forms state if expression 1 is true then the value returned will be expression 2 or else the value returned will be expression 3. This expression is written in place of traditional if statement.

illustration
y=(x<5?3:4);

This statement will store 3 in y if x is greater than 5 or else it will store 4 in y.


Related Discussions:- Define the conditional operator in c language

multithreaded server, Implement a multithreaded server that can be used as...

Implement a multithreaded server that can be used as a proxy server to access some designated file (say it reflects the proxy copy of two file1.txt, file2.txt). Now use a client to

Switch...case, Write a function to accept a character and display it 40 tim...

Write a function to accept a character and display it 40 times.

Program Preprocessor variable postfix , Run the following C++ program with ...

Run the following C++ program with and without preprocessor variable POSTFIX defined. #include using namespace std; extern "C" int atoi( const char *str );

What are the benefits of using friend classes, What are the benefits of usi...

What are the benefits of using friend classes? - Friend classes are useful when a class wants to hide features from users which are required only by another, tightly coupled cl

Describe overloading??, A: Along with the C++ language, you can overload op...

A: Along with the C++ language, you can overload operators and functions. Overloading is the practice of supplying more than one definition for a provided function name in the same

Pointers, In this sub-task will you implement three functions for the final...

In this sub-task will you implement three functions for the final three function prototypes that will do exactly the same as the three functions that you have just written. This ti

Program to sort a range of numbers with insertion, Program to sort a range ...

Program to sort a range of numbers with Insertion: /* define variable */ const int max=29000; int list[max]; FILE *fp; clock_t start,end; char any1[8];

Super ASCII string cost, A string S is said to be "Super ASCII", if it cont...

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd