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

String, Write a program that takes 3 small letters as input and sort them a...

Write a program that takes 3 small letters as input and sort them according to their ASCII value.

Explain reference oddities, Reference Oddities A reference variable can...

Reference Oddities A reference variable can demote to any integer variable, be it in an array or a member variable from structure or class. Reference variables can demote to co

Define automatic storage classes - computer programming, Define Automatic s...

Define Automatic storage classes - computer programming? The Variables declared within function bodies are automatic by default and automatic variables are declared inside a fu

Where are longjmp and setjmp used in c++, Where are longjmp and setjmp used...

Where are longjmp and setjmp used in C++? -Setjmp and longjmp must not be used in C++. - Longjmp jumps out of the function without unwinding stack. This means that local obj

How can I fix this to, Write a program consisting of two functions (plus ma...

Write a program consisting of two functions (plus main). The first function should read in a number and then pass this back to main. This value should then be passed into a secon

Coding, A palindrome is a string that reads the same from both the ends. Gi...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Radix, a popular joke among computer is to say............

a popular joke among computer is to say............

Function that have parameter and makes an integer mask, Write a function th...

Write a function that has an int parameter n, makes an integer mask having the bit 1 at the nth place from the rightmost bit, and returns the mask. For example, when n = 5 is passe

Function, Write a C++ program according to the following specifications 1. ...

Write a C++ program according to the following specifications 1. Display a brief description of the program. 2. Ask the user to specify the type of loading (end load, intermediate

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