top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to find maximum of three numbers a,b,c and store in number in a single line ?

+1 vote
88 views
How to find maximum of three numbers a,b,c and store in number in a single line ?
posted Dec 8, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes
#include <stdio.h>
#define MAX_OF_THREE(a,b,c) (a>b)?((a>c)?a:(c>b)?c:b):((b>c)?b:c)
int main()
{
    int a=7,b=5,c=5;
    printf("maxm no %d\n",MAX_OF_THREE(a,b,c));
}
answer Dec 9, 2014 by Bheemappa G
0 votes

include<stdio.h>

main()
{
int a=10,b=20,c=30;
a>b?a>c?printf("a is greater\n"):printf("c is greater\n"):b>c?printf("b is greater\n"):printf("c is greater\n");
}

answer Dec 9, 2014 by Chirag Gangdev
Similar Questions
+4 votes

"Given an array of strings, find the string which is made up of maximum number of other strings contained in the same array. e.g. “rat”, ”cat”, “abc”, “xyz”, “abcxyz”, “ratcatabc”, “xyzcatratabc” Answer: “xyzcatratabc”

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...