/* Find largest value between two variables - single line - Conditional Operator */
#include<stdio.h>
int main()
{
int a,b,d;
printf("Type values of A and B : ");
scanf("%d %d",&a,&b);
d=(a>=b?a:b);
printf("Greatest value : %d",d);
return 0;
}
Related Post:
Find larger value between two variable
http://cbasicprogram.blogspot.in/2012/01/find-larger-value-between-two-variable.html
#include<stdio.h>
int main()
{
int a,b,d;
printf("Type values of A and B : ");
scanf("%d %d",&a,&b);
d=(a>=b?a:b);
printf("Greatest value : %d",d);
return 0;
}
Related Post:
Find larger value between two variable
http://cbasicprogram.blogspot.in/2012/01/find-larger-value-between-two-variable.html
please provide program to find largest of three variables using same conditional operator
ReplyDeleteVarious aspects of your query - https://www.computerscienceai.com/2018/02/c-program-to-accept-three-integers-as.html
Deletenice article for beginners.thank you.
ReplyDeletewelookups C++
javacodegeeks
For theory I referred from here , but finally found some programs about operators.
ReplyDelete