C Programming Tutorial – 16 – Short form of if :

Note:

  • //Short form of if:   ( ….. ) ?   ….. : ….. ;

Code:
—————————

#include <stdio.h>
#include <stdlib.h>

int main()
{

int num=11;
(num>10) ? printf(“It is grater that 10 \n”) :   printf(“It is less than 10 \n”);

return 0;

}