Number Arrangement
write a program to re-arrange all the numbers appearing in the string in decreasing order.
Note: There will not be any negative numbers or numbers with decimal part.
The input is a string containing the actual sentence.
The output is a string containing the modified sentence as mentioned above.
For example, if the actual sentence is It is a 3days 4nights holiday trip.
The numbers in the sentence are 3 and 4.After arranging them in the decreasing order, the output looks like It is a 4days 3nights holiday trip.
Sample Input1
It is a 3days 4nights holiday trip
Sample Output1
It is a 4days 3nights holiday trip
Lowest and Highest score
The teacher gave out the scores of the science quiz conducted last week and asked the ones with the lowest and highest scores to group up. Print the names of the students with minimum and maximum scores, respectively.
Note: In case of a tie, choose the name which comes first in the (dictionary order).
Sample Input1
2
shakti 24
disha 26
Sample Output1
shakti disha
Sample Input2
3
ajay 23
bijay 24
sanjay 23
Sample Output2
ajay bijay
Which of the following apply to the while loop only? To the do...while loop only? To
both?
a. It is considered a conditional loop.
b. The body of the loop executes at least once.
c. The logical expression controlling the loop is evaluated before the loop is
entered.
d. The body of the loop may not execute at all.
Identify a real world problem in the society that can be solved using a computer, define the problem and propose a possible solution.
Problem definition:
Ideal situation-
Current situation-
Consequences-
Proposal-
Joel's Electronics company needs a new program to better manage their inventory. They need a report each day that shows what products were sold during the day and the quantity available at that time. Following the PDLC, show how the project should be developed.
Analysis-
Design-
Implementation/coding-
Testing-
Deployment-
compare serial processing systems and Simple Batch systems in context of evolution of operating systems
pythagorean triplet
arun is in a class with N students he knows the height of each student in the class. he then tries to answer Q queries. in each query, he is given an integer X and he has to find the number of students in the class who have a height of at least X
I/p: the 1st line of input two space separated integers N & Q. The second line of input contains N space separated integers, the height of the N students in the class. each of the next Q lines contain one single integer X.
output: the output consists of Q lines where each line contains the answer of J th query (1<=j<=0)
I/p: 3 1
100 160 130
120
O/p: 2
input: 5 5
1 2 3 4 5
6
5
4
3
2
output:
1
2
3
4
a class of students p gave a science viva their final results are listed out in the order of their roll numbers in the list s the teacher asked the students to note the number of students who gave the viva after them and got less score than them write a program to get the final list from the students in the roll number order
I/p: the 1st line contains a single integer N that represent the no.of students in class. the 2nd line contains N space separated integers representing the scores of the students in the order of their roll no.s
O/p: the output should contain N space separated integers representing the count of students as mentioned above
Input : 3
13 12 11
output: 2 1 0
input: 4
4 3 5 2
output:
2 1 1 0
Sum of Non-Diagonals
Write a program to print the following,
Sample Input1
3
9 8 7
6 5 4
3 2 1
Sample Output1
20