Java Program to Add Two Matrices

Write a java program to add two matrices.

For example : Given two matrices A and B the sum of these two matrices is A + B.

{1,  5,  1}                   {1,  1,  9}              {2,  6,  10}
{2,  8,  2}      +         {2,  2,  3}    =       {4,  10,  5}
{3,  7,  1}                  {5,  6,  4}              {8,  13,  5}

Find Largest of Three Numbers using Ternary Operator in Java

Write a java program to find largest of three numbers using ternary operator in java. This problem can also be asked like, find maximum of three numbers using conditional operator.

Given three input numbers, Write a java code to print largest or biggest of three numbers using ternary operator.

Suppose, Given three input numbers a, b and c. If a is greater than b and c then a is the largest of three numbers. Similarly, if b is greater than a and c then b is the largest of three numbers else c is largest.