Triplet sum
Given an array n integers, find and print all the unique triplets (a,b,c) in the array which give the sum K.(a+b+c=K)
Input
The first line of the input will be space separated integers, denoting the elements of the array. The second line of the input will be an integer denoting the required sum K.
Output
The output should be multiple lines, each line containing a unique triplet. The elements of the triple must be sorted in increasing order and all the triplets printed must be sorted in increasing order. Print"No matching triplets found" if there are no triplets with the given sum.
Sample input
0 12 17 8 9 21
29
Sample output
(0, 8, 21)
(0, 12, 17)
(8, 9, 12)
You have been contacted as a policy expert to very briefly, advice government to institute food tax policy based on the following policy objectives:
(a) The government has the policy objective of raising tax revenue on foods? (5 Marks)
(b) The government has policy objective of changing the consumption behavior of citizens by taxing food?
You have to write a menu-driven program that asks the user to select a favorite color from the given colors. Keep asking the user three times for selecting the color from the list of the available colors. Do this with the help of a suitable loop and switch statement. Finally, you have to display the three favorite colors of the user.
What is the relationship between a firm total revenue, profit, and total cost
What is the change in energy of a system that requires 80 J of energy to do 150 J of work?
Rotate matrix rings
Given a matrix of order M*N and a value K, write a program to rotate each ring of the matrix clockwise by K elements. If in any ring has less than or equal to K elements, then don't rotate that ring.
Input:
The first line of input will be two space separated integers, denoting the M and N. The next M lines will contain N space separated integers. The next line will contain an integer, denoting K
Output:
The output should be M*N matrix by K elements.
Sample input:
3 4
1 2 3 4
10 11 12 5
9 8 7 6
2
Sample output:
9 10 1 2
8 11 12 3
7 6 5 4
Create an application that will take 5 employees data and print the data.take a skill name and print all the employee who have skill
find the inverse of f(x) = 5/2 − x, x < 2 ;
1/x, x ≥ 2
You built a circuit consisting of three parallel plate capacitors with capacitances of 2.0 F, 3.0 F, and 5.0 F, respectively, which are connected in parallel. The whole circuit is connected to a 100 V line. What is the (a) total capacitance, (b) charge stored in each capacitor, and (c) potential difference across each capacitor?
An inclined plane as shown in figure 1 is used to raise an object of mass 30 kg. If the plane is
inclined 5° above the horizontal and the coefficient of friction is 0.20, calculate the ideal
mechanical advantage, actual mechanical advantage, and the efficiency of this machine.