Half Pyramid - 3
Given an integer
N as a starting number and K as input, write a program to print a number pyramid of K rows as shown below.
Input
The first line of input is an integer
N. The second line of input is an integer K.
Explanation
In the example, the given starting number is
10, and the number of rows in the pyramid is 5.
So, the output should be
10
11 12
13 14 15
16 17 18 19
20 21 22 23 24
Sample Input 1
10
5
Sample Output 1
10
11 12
13 14 15
16 17 18 19
20 21 22 23 24
Sample Input 2
1
3
Sample Output 2
1
2 3
4 5 6
Get the distinct ids of videos that belong to the following genres.
genre_id genre
201 Comedy
202 Action
203 Thriller
211 Scifi
Note:
Sort the output in the descending order of
video_id
Expected Output Format
video_id contains 14 rows
...
genre_id genre_type
201 ACTION
202 COMEDY
203 THRILLER
204 ROMANTIC
205 TECHNICAL
206 HEALTH CARE
207 GAMING
208 MUSIC VIDEOS
209 TEASER
210 INSPIRATIONAL
211 SCI-FI
Get all the channel_ids that uploaded at least 20 videos in "AI/ML", "Cyber Security", "Data Science" or "Robotics" technologies between 2018 and 2021.
Example: If a channel publishes 5 videos in AI/ML, 10 videos in Cyber Security and 5 videos in Data Science, consider the channel.
Note:
Consider all the videos that have any of the technologies mentioned above in theirname
Sort the output in the ascending order of channel_id.
Expected Output Format
channel_id
Video Table
video_id name duration_in_secs published_datetime no_of_views channel_id
1000 Getting My Driver's License | Lele Pons 3652 2011-12-05 19:00 10619 367
1001 Apple iPhone X Review: The Best Yet! 4556 2021-01-19 20:12 140012 362
Write a C program to implement the following equations:
a) 2x5 - 3x4 + 5x3 - 3x2 + 7x – 9
Where x is the user defined value.
b) x3sin(tan(45)) + 4x + 7cos(90x2)
Where the value of x is a floating point number provided by the user.
Write a c++ program to calculate Gross salary(net salary+DA+TDS) for 4 employees where overload the +
operator for getting the total salary obtained by all the 4 employees. Also get the average salary of employees
by operator overloading. display all the details of all four employees. Also display who is getting highest
salary. Employee salary must be entered by the user at runtime.
User_ID
User_Name
Salary
Department
201
William
10000
MRKT
202
Michael
20000
HR
203
Anthony
30000
MRKT
204
Aiden
40000
HR
205
Matthew
50000
IT
Perform the following queries for above table:
1. Write a SQL query to display User name who is taking maximum salary.
2. Write a SQL query to display second highest salary from user table.
3. Find names of user starting with ‘A’.
4. Find number of users working in department ‘HR’.
5. Print details of users whose name ends with ‘m’ and contains 6 Alphabets.
6. Print details of users whose salary between 20000 and 50000.
7. How many records do we have?
8. write a query to find How many jobs do we have?
10. Add Column Bonus Salary in usertable.
In the given example, the first side
A = 3, and the second side B = 4. To calculate the hypotenuse we use Pythagoras theorem. According to Pythagoras theorem, hypotenuse2 = 32 + 42
Therefore, the hypotenuse value is
5. So, the output should be 5.
W pattern with *
Write a program to print
W pattern of N lines using an asterisk(*) character as shown below.
Note: There is a space after each asterisk * character.
Input
The first line is an integer
N.
Explanation
For
N = 5
The output should be
* * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *
Sample Input 1
5
Sample Output 1
* * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *
Sample Input 2
4
Sample Output 2
* * * * * * *
* * * * * *
* * * *
* *