Minimal Absolute Difference
There are N pyramids in a line.You are given their heights as a list of integers.Write a program to find the minimum absolute difference between the heights of any two different pyramids.
Input
The input is a single line containing space-separated integers.
Output
The output should be a single line containing the minimum absolute difference of any two different pyramid heights.
Explaanation
Given Pyramid heights are 7 1 5.
The absolute difference between the heights of any two different pyramids are
you are given an m*n matrix.write a program to compute the perimeter of the matrix and print the result.perimeter of a matrix is defined as the sum of all elements of the four edges of the matrix
m = no of rows
n = no of columns
Ex: [1 2 3 4
5 6 7 8
9 10 11 12]
Perimeter : 1+2+3+4+8+12+11+10+9+5 = 65
Note: take input from the user.
A machine is purchased which will produce earning of Rs.
1000 per year while it lasts. The machine costs Rs. 6000 and
will have a salvage of Rs. 2000 when it is condemned. If 12
percent per year can be earned on alternate investments
what would be the minimum life of the machine to make it a
more attractive investment compared to alternative
investment?
A group of people playing a game They are standing in a line each carrying a card with a number on it. this numbers or given in the list A. A random number S is selected
let a and b are two linked list.write a c++ function to create a new linked list c that contains alternately from a and b beginning with first element of A.if you run out of element in one element of the list,then append the remaining elements of the other elements of c.
Product of the String
You are given an alphanumeric string S.Write a program to multiply all the charcters(except trailing zeroes) in S and print the output.
Rules for multiplication:
Input
The first line contains a string S.
Output
The output should be a integer denoting the product of characters.
Explanation
For N = 123a4
ASCII value of a is 97.
Product of digits of ASCII value of a is 9 *7 = 63.
Therefore the product of characters is 1*2*3*4*63*4 = 1512.
Sample Input1
123a4
Sample Output1
1512
Product of the String
You are given an alphanumeric string S.Write a program to multiply all the charcters(except trailing zeroes) in S and print the output.
Rules for multiplication:
Input
The first line contains a string S.
Output
The output should be a integer denoting the product of characters.
Explanation
For N = 123a4
ASCII value of a is 97.
Product of digits of ASCII value of a is 9 *7 = 63.
Therefore the product of characters is 1*2*3*4*63*4 = 1512.
Sample Input1
123a4
Sample Output1
1512
Product of the String
You are given an alphanumeric string S.Write a program to multiply all the charcters(except trailing zeroes) in S and print the output.
Rules for multiplication:
Input
The first line contains a string S.
Output
The output should be a integer denoting the product of characters.
Explanation
For N = 123a4
ASCII value of a is 97.
Product of digits of ASCII value of a is 9 *7 = 63.
Therefore the product of characters is 1*2*3*4*63*4 = 1512.
Sample Input1
123a4
Sample Output1
1512
In plane geometry, the x- and y axis of a 2D Cartesian system divide it into four infinite regions called quadrants. Your task is to model each point with an x-value and y-value. Apart from the constructors, getters and setters, implement a getQuadrant method to determine the region in which a given point falls. Sample Run1 Sample Run2 Enter the x and y value: 5 8 Enter the x and y value: 7 -3 Output1: Point (5,8) is in Quadrant I Output2: Point (7,-3) is in Quadrant IV
Machine Problem 5.8.
Write a program using two-‐dimensional arrays that lists the Odd numbers and Even numbers separately in a given 12 input values.
Sample input/out dialogue:
Enter twelve numbers: 15 20 13 35 40 16 18 20 18 20 19
Odd numbers are: 15 13 35 19
Even numbers are: 40 16 18 20 18 20