C Program : Conditional OR Ternary Operator (?:)

 #include <stdio.h>

int main() { int num1, num2, max; printf("Enter the first number: "); scanf("%d", &num1); printf("Enter the second number: "); scanf("%d", &num2); // Use the conditional operator to find the maximum of the two numbers max = (num1 > num2) ? num1 : num2; printf("The maximum number between %d and %d is: %d\n", num1, num2, max); return 0; }

Comments

Popular posts from this blog

Video Formats

Where video editing is used

File saving and folder management