Problem Statem
2.
Implement the following function:
int CreateNum(int a, int b, int c);
The function accepts integers 'a', 'b' and 'c' as its argument. Integers 'a', 'b' and 'c' are to be sorted in descending order and then, first
'y' and the last value is substituted in 'z'. A 3-digit number 'xyz' is created using the values of 'x', 'y' and 'z'. Implement the function to
(100 * x) + (10 * y) + z
xyz =
Assumption: 0 <= (a, b, c) <= 9
Note: Return o if all a, b, c are o.
Example:
Input:
15
a: 1
b: 8
C: 5
Output:
851
Explanation:
Descending order of a, b, c is {8,5, 1}
Substituting x, y, z as follows:
71516
x = 8
y = 5
Z= 1
Integer xyz = (100 *'x) + (10 * y) + z = (100 * 8) + (10 * 5) + 1 = 851. Thus, output is 851.
Sample Input
a: 3
b:
C: 7
Sample Output
730
Instructions :
Answers
Answered by
0
Answer:
Ques. What does the following C-statement declare?
int (*f) (int * );
- A function that takes an integer pointer as argument and returns an integer
- A function that takes an integer as argument and returns an integer pointer
- A pointer to a function that takes an integer pointer as argument and returns an integer
- awesome function that takes an integer pointer as argument and returns a function pointer
Ans..A function that takes an integer pointer as argument and returns an integer ⇒int f(int∗)⇒int f(int∗)
A function that takes an integer as argument and returns an integer pointer ⇒int∗f(int)⇒int∗f(int)
A pointer to a function that takes an integer pointer as argument and returns an integer ⇒⇒
int (*f) (int * );
So, answer is C.
Attachments:
Similar questions
Social Sciences,
1 month ago
English,
1 month ago
Chemistry,
1 month ago
Hindi,
2 months ago
Physics,
2 months ago
Computer Science,
9 months ago