Trapezium Order
You are given an integer N Print N rows starting from 1 in
the trapezium order as shown in the output of the below examples.
Input
The input contains an integer N.
Output
The output should have N lines.
Each of the N lines should have space-separated stegers as per the trapezium order.
Sample Input 1
4
Sample Output 1
1 2 3 4 17 18 19 20
5 6 7 14 15 16
8 9 12 13
10 11
Write a program that will read integers and find the total and average of the input values. Your program should end when the input is 0.
Write a function to fine the ceiling of a double value and write a function to fine its floor. The ceiling of a number is the smallest integer greater than or equal to that number .the floor of a a number is the largest integer bless than or equal to that integer. For example the ceiling of 5.4 is 6 and the floor of 5.4 is 5.
Write a program to define a class book that will contain Title, Author and Price of the book as data members. Define Null Constructor, parameterized constructor and copy constructor for the class and a function to display the details of an object. Use the new operator to initialize object of this class through a pointer and display the data member through a member function.
Write a c++ program that creates a one dimensional array with of length5 integers from the keyboard into the array .your to perform sequential search for an integer in the array and insert a new intem in that location of the array.
Write a program that Will short thee integers .the integers are entered from the keyboard and stored in variable num1,num2,num3 respectively. The program sorts the numbers so that num1<=num2<=num3.
Given an unsorted dynamic array (arr) and two numbers x and y, find the minimum distance between x and y in the array (arr) using functions. The array might also contain duplicates. You may assume that both x and y are different and present in the array (arr). You are also advised to NOT use the INT_MAX and abs() function.
Sample Input & Output
Input: arr[ ] = {3, 5, 4, 2, 6, 5, 6, 6, 5, 4, 8, 3}, x = 3, y = 6
Output: Minimum distance between 3 and 6 is 4
(3 to 5 => 1 unit, 5 to 4 => 1 unit, 4 to 2 => 1unit & 2 to 6 => 1 unit
So, Total Minimum Distance = 1+1+1+1 = 4)
3.13. Create the user with following details:
Login name umcovida shell /bin/bash
Full name Mcovida Lengana Home folder /homestu/umcovida
Default group wanafunzi Group ID 20212