Anti-Diagonals
Given a MxN matrix,write a program to print all Anti-Diagonals elements of matrix
Input
The first line of input will contain a M, N values separated by space.
The second line will contain matrix A of dimensions MxN.
Output
The output should contain anti-diagonal elements separated by a line.
Explanation
For example, if M = 4, N = 4
Matrix A:
4 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
So the output should be
1
2 5
3 6 9
4 7 10 13
8 11 14
12 15
16
Sample Input 1
2 3
1 5 5
2 7 8
Sample Output 1
1
5 2
5 7
8
Sample Input 2
3 4
1 2 3 4
5 6 7 8
9 10 11 12
Sample Output 2
1
2 5
3 6 9
4 7 10
8 11
12Numbers in String - 2
Given a string, write a program to return the sum and average of the numbers that appear in the string, ignoring all other characters.Input
The input will be a single line containing a string.Output
The output should contain the sum and average of the numbers that appear in the string.
Note: Round the average value to two decimal places.Explanation
For example, if the given string is "I am 25 years and 10 months old", the numbers are 25, 10. Your code should print the sum of the numbers(35) and the average of the numbers(17.5) in the new line.
Create a program with this statement to declare a array of integers. int myarray[]={4,77,6,22,3,98};
In the same program create a linked list of integers and in a loop, cycle through the array and store the five values in the linked list.
The Model-View-Controller design pattern decouples data access, business logic, data presentation, and user interaction. Discuss.
c++ program that find x when i input a, b and c. (using quadratic equation)
what is recursive definition defined in detail with examples?
Write four different Java statements that each add 1 to integer variable x.
company insures its workers in the following cases: If the workers is female and married. If the workers is married, male and above 65 years of age. If the driver is unmarried, female and above 45 year Write C++ a program to determine whether the driver is insured or not, using switch statement only
The area of a rectangle is the rectangle’s length times its width. Write a program that asks for the length and width of two rectangles. The program should tell the user which rectangle has the greater area, or if the areas are the same.