Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Ternary operator example
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int x = 3, y = 8;
- int min = (x < 7) ? x : y; //"returns" a value
- printf("conditional op result: %d \n", min);
- return 0;
- }
- /*
- if (x < y)
- min = x;
- else
- min = y;
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement