Sizeof operator is a unary operator which can be used to calculate size of the operand.The result of sizeof is of unsigned integral type which is denoted by sizeof(); . we can applied into datatype like integer and floating-point types, pointer types, or compound datatypes such as Structure, union etc.
#include<stdio.h> int main() { int a=7; printf("size=%d",sizeof(a)); }
size=2
A ternary operatr is the operator which is expessed as:
condition1 ? excute1 : excute2;It means if the condition1 is true then execute1 will execute else execute2 will execute.It works like like a if else condition.
#include<stdio.h> int main() { int a=7,b=5,x; (a<b ? x=2 : x=7); printf("x=%d",x); }
x=7