Q:

Write a program to print compare two numbers using ternary operators

0

Write a program to print compare two numbers using ternary operators

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program:

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
printf("enter two number");
scanf("%d",&a,&b);
c=((a>b)?a:b);
printf("%d is greater",c);
getch();
}

Output:

enter two number 12 24
24 is greater

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now