#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)); }
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"); }
"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”
It was asked today in interview but could not crack it, any help.