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

Minimum shelves, write a program to find the minimum number of shelves

write a program to find the minimum number of shelves

C program for pattern star, 1 PETTERN1 (Pettern1.c)   main() { ...

1 PETTERN1 (Pettern1.c)   main() {           int i,j,k=1,a;           clrscr();           for(i=1;i           {                    if(i>=3)

Networking program development, Networking program development. 1.ARP pr...

Networking program development. 1.ARP protocol. 2.Switching HUB. 3.wireshark. 4.winpcap library. 5.C++ & MFC. 6.LAN evironment through switch and HUB(static ARP t

C program to print character array, Program to print character array : ...

Program to print character array : Write a program to print the character array by using string class functions. void main() {  char line[30];   int i=0;   clrsc

C program for reverse the string , C Program for REVERSE THE STRING #i...

C Program for REVERSE THE STRING #include stdio.h> #include conio.h> #include string.h> void main() {           char name[30];           char *s;

Define inline functions, Inline Functions Imagine a c program, which re...

Inline Functions Imagine a c program, which reads disk records having employee information. If this is a payroll application each employee record data is probably processed by

Volume, how to find the volume of cone , cylinder and sphere ?

how to find the volume of cone , cylinder and sphere ?

Data structyres, What data structure would you mostly likely see in a nonre...

What data structure would you mostly likely see in a nonrecursive implementation of a recursive algorithm?Minimum 100 words accepted#

Decode the code, Smugglers are becoming very smart day by day. Now they hav...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

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