(only by if-else and nested if- else)
Write a program that ask the users to enter three characters. Then the program should display the
following menu
1. Sort in Ascending order
2. Sort in Descending order
The program should perform sorting of these three characters in ascending or descending order as per the
user requirement.
(only by if-else or nested if-else) (not by loops)
Write a program which calculates the monthly Budget of a person. The program will read the
monthly salary of the person. Then give following options:
Press 1 to calculate gas bill charges
Press 2 to calculate electricity bill charges
Press 3 to calculate fueling charges.
Press 4 to calculate house rent charges
His monthly gas bill charges are 10% of his salary, electricity bill charges are 5% of his salary. His monthly
fueling charges are 10% of his salary, and his house rent charges are 15 %. Your program will calculate and
display the corresponding charges based on the selection (1, 2, 3, or 4)
Write a program that reads 10 integers from user and then finds and prints all the Odd numbers that are divisible by 5.
(Please Only DO it by IF-Else or Nested if else) (not by loops)
Write a program which takes your age as an input and output of your program should b like this
You are 24 years old
One year ago,you were 23
In one year you will be 25
Suppose there is class of 10 students who have CGPA between 0-10. The university has decided to give the grace for those students those who have the CGPA between 4.5 to 4.9 to make it 5. Identify the students those have CGPA after adding the grace marks. Suppose students have its Roll_no & CGPA. Add the grace CGPA to the obtained CGPA of student by adding grace of 5 marks into the students through list comprehensions. Input Format- The input should contains an array of roll_no,and CGPA of the students. Constraints- CGPA must lies between 1.0 to 10.0 otherwise print "invalid input" Output Format- For each test case, display the roll_no and increased CGPA of those students only who lies between the obtained CGPA of 4.5-4.9
Given a three-digit integer N and an integer K, returns the maximum possible three-digit value that can be obtained by performing at most K increases by 1 of any digit in N.
Write a non-member function that that takes 2 linked lists as
constant arguments and returns a new linked list that contains
every number the two lists do NOT have in common. If list1
contains the numbers 3, 2, 4, 9, 8, 1, 0, 5 and list2 contains the
numbers 0, 1, 7, 6, 4, 5, 9, then the function should return a list of
the numbers 2, 3, 6, 7, 8 in any order. The time complexity of
function should be O(N).
num number:= #
fact number:= 1;
temp number;
begin
temp := num;
while (num > 0)
loop
fact := fact * num;
num := num - 1;
end loop;
Dbms_Output.Put_line('factorial of ' || temp || ' is ' || fact);
Write a non-member function that shuffle-merge the nodes of
the two linked lists (list1 and list2) to First list, by taking nodes
alternately from the two lists such that the resultant list contains
distinct elements. Both lists contain unique elements each but can
have common elements. For example, if list1 contains {1 3 5 7}
and list2 contains {11 12 5 13 14}, then after the function call
shuffleMerge(list1,list2), list1 should contain
{1->11->3->12->5->13->7->14} and list2 should be empty now.
Note: You are NOT allowed to create any new node in this
function.
Create a program that will accept three numbers as inputs and then specifies which of them has the greatest value.