Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Sum of the series

Write a program to find the sum 

S of the series where S = x - x^3 + x^5 + ....... upto N terms.

Input

The first line of input is an integer 

X. The second line of input is an integer N.

Explanation

If we take 

X value as 2 in the series upto 5 terms.

Then the series is 2 - 23 + 25 - 27 + 29

So, the output should be 

410.

Sample Input 1
2
5
Sample Output 1
410
Sample Input 2
3
2
Sample Output 2
-24

Inverted Solid Right Triangle

Given an integer number 

N as input. Write a program to print the right-angled triangular pattern of N lines as shown below.

Note: There is a space after each asterisk (*) character.

Input

The first line of input is an integer 

N.

Explanation

In the given example the solid right angled triangle of side 

4. Therefore, the output should be

* * * * 
  * * * 
    * * 
      *
Sample Input 1
4
Sample Output 1
* * * * 
  * * * 
    * * 
      *
Sample Input 2
5
Sample Output 2
* * * * * 
  * * * * 
    * * * 
      * * 
        *

Solid Right Angled Triangle - 2

Given an integer number 

N as input. Write a program to print the right-angled triangular pattern of N lines as shown below.

Note: There is a space after each asterisk (*) character.

Input

The first line of input is an integer 

N.

Explanation

In the given example, the solid right-angled triangle of side 

5. Therefore, the output should be

        * 
      * * 
    * * * 
  * * * * 
* * * * *
Sample Input 1
4
Sample Output 1
      * 
    * * 
  * * * 
* * * *
Sample Input 2
6
Sample Output 2
          * 
        * * 
      * * * 
    * * * * 
  * * * * * 
* * * * * *

Right Angled Triangle - 3

Given an integer number 

N as input. Write a program to print the right-angled triangular pattern of N rows as shown below.

Input

The first line of input is a positive integer.

Explanation

For example, if the given number is 

5, the output should be

______
|    /
|   /
|  /
| /
|/
Sample Input 1
5
Sample Output 1
______
|    /
|   /
|  /
| /
|/
Sample Input 2
7
Sample Output 2
________
|      /
|     /
|    /
|   /
|  /
| /
|/

Hollow Right Triangle - 2

Given an integer number 

N as input. Write a program to print the hollow right-angled triangular pattern of N lines as shown below.

Note: There is a space after each asterisk (*) character.

Input

The first line of input is an integer 

N.

Explanation

In the given example the hollow right angled triangle of side 

5. Therefore, the output should be

        *
      * *
    *   *
  *     *
* * * * *
Sample Input 1
4
Sample Output 1
      *
    * *
  *   *
* * * *
Sample Input 2
5
Sample Output 2
        *
      * *
    *   *
  *     *
* * * * *

Hollow Right Triangle

Given an integer number 

N as input. Write a program to print the hollow right-angled triangular pattern of N lines as shown below.

Note: There is a space after each asterisk (*) character.

Input

The first line of input is an integer 

N.

Explanation

In the given example the hollow right angled triangle of side 

4. Therefore, the output should be

* * * *
  *   *
    * *
      *
Sample Input 1
4
Sample Output 1
* * * * 
  *   *
    * *
      *
Sample Input 2
6
Sample Output 2
* * * * * * 
  *       *
    *     *
      *   *
        * *
          *


write a program to print the values as given in output

input: [1, 2, 3, 4, [8, 7, 6, 5], 9, 10, 11, 12, [16, 15, 14, 13], 17, 18, 19, 20, [22, 22, 21, 20]]

output : 1,2,3,4,8,7,6,5,9,10,11,12,16,15,14,13,17,18,19,20,22,22,21,20


Question 2

Using C or C++ or a program of your choice, write a program that list the storage size of a float, list the minimum and maximum float values, and the precision of the float.


Question 3

Describe the steps of how you will compile the program written in Question 2 above in a typical compiler such as gcc or a compiler of your choice. Show the output of how you have compile the program written in Question 2 above and attach all files generated where applicable.


Describe the parts/components of a language processing system and describe the role each component plays in the compilation process

What is the output of each part of the language processing system


Write a programme for displaying a school with different labs and their equipment’s and their prices


LATEST TUTORIALS
APPROVED BY CLIENTS