Largest Missing Negative Number
You are given an unsorted array
The first line contains
The output contains
Given
A = -2 -1 0 1 2.The largest negative number missing is
-3.
Sample Input 1
-2 -1 0 1 2
Sample Output 1
-3
Vertical Printing
You are given a string(
S) with multiple words in it. Return all the words vertically in the same order in which they appear in S.Complete with spaces when it is necessary while forming the words vertically. (Trailing spaces are not allowed).
Note: All characters in
The first line contains a string
Each line of the output contains a string formed vertically as mentioned above.
Given
S = CAT BAT VIN.We are expected to print the words vertically such that considering the
ith letter in each line of the output will form the ith word in the given input.Printing the given words vertically
CBV
AAI
TTN
Joining all the first characters from the 3 lines of output gives
CAT. Joining all the second characters from the 3 lines of output gives BAT. Joining all the third characters from the 3 lines of output gives VIN.
Sample Input 1
CAT BAT VIN
Sample Output 1
CBV
AAI
TTN
Smaller Scores
A group of people(
P) are playing an online game. Their scores are stored in the order of their entry time in S. Each integer S[i] corresponds to the score of the person Pi.For each person
The first line contains a single integer
The output should contain
Given
S = 13 12 11Score of
P1 is 13. Score of P2 is 12. Score of P3 is 11.The number of people who played after
P1 and scored less than 13 is 2(12, 11). The number of people who played after P2 and scored less than 12 is 1(11). The number of people who played after P3 and scored less than 11 is 0.
The output is
2 1 0.
Sample Input 1
3
13 12 11
Sample Output 1
2 1 0
Create a library management system in which you have a pile of 4 books stacked over one another. Each book has a book number. Make a program in which a librarian stacks a pile of books over one another. A student wants to issue a book. The program first searches if the book is present in the stack or not. If the book has not been issued, the program finds out the index of the book. It also pops other books on the top of it to issue the book to the student. Display the books in the stack. (Hint: report the count of the books above the required book and use the pop() function “count” times.)
You are given the temperature T of an object in one of Celsius, Fahrenheit, and Kelvin scales.
Write a program to print T in all scales viz Celsius, Fahrenheit, and Kelvin.
Formula to convert from Fahrenheit F to Celsius C is C = (F - 32) * 5 / 9.
Formula to convert from Kelvin K to Celsius C is C = K - 273.
Here "C", "F", "K" represent that the temperature scale is in Celsius, Fahrenheit and Kelvin scales respectively.
The input contains the temperature (a number) and the unit of the temperature scale (C, F, K) without any space.
Input
The first line of the input contain a temperature Value in one of Celsius, Fahrenheit, and Kelvin scales.
Write down the routing table for all routers. Routing protocol used is RIP. The subnet mask used is 255.255.255.0
Write C++ programs that illustrate how the following forms of inheritance are supported:
a)Single inheritance
b)Multiple inheritances
c)Multi-level inheritance
d)Hierarchical inheritance
Design a recursive function that accepts an integer argument, n, and prints every second number from n down to a minimum of 0. Assume that n is always a positive integer.
* Please select the correct letter choice "A, B, C, D, or E"
10. Which can set the background color of "panel1" to red?
A. panel1.setBackground(red);
B. panel1.setBackgroundColor(red);
C. panel1.setBackground(Color) = "red";
D. panel1.setBackground(Color.red);
E. panel1.setBackground = Color.red;
* Please select the correct letter choice "A, B, C, D, or E"
9. Which can nullify a JPanel’s layout manager?
A. pane1.setLayout(void);
B. pane1.setLayout(no);
C. pane1.setLayout(false);
D. pane1.setLayout();
E. pane1.setLayout(null);