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

Armstrong numbers between two intervals

Write a program to print all the Armstrong numbers in the given range 

A to B(including A and B). An N-digit number is an Armstrong number if the number equals the sum of the Nth power of its digits.

Input

The first line has an integer 

A. The second line has an integer B.

Output

Print all Armstrong numbers separated by a space.
If there are no Armstrong numbers in the given range, print 

-1.

Explanation

For 

A = 150 and B = 200

For example, if we take number 153, the sum of the cube of digits 

1, 5, 3 is

 13 + 53 + 33 = 153.

So, the output should be 

153.

Sample Input 1
150
200
Sample Output 1
153
Sample Input 2
1
3
Sample Output 2
1 2 3




Pyramid

Given an integer

N, write a program to print a pyramid of N rows as shown below.Input

The first line of input is an integer

N.Explanation

In the example, the number of rows in the pyramid is

5.So, the output should be

Sample Input 1
5
Sample Output 1
. . . . 0 . . . . 
. . . 0 0 0 . . . 
. . 0 0 0 0 0 . . 
. 0 0 0 0 0 0 0 . 
0 0 0 0 0 0 0 0 0
Sample Input 2
6
Sample Output 2
. . . . . 0 . . . . . 
. . . . 0 0 0 . . . . 
. . . 0 0 0 0 0 . . . 
. . 0 0 0 0 0 0 0 . . 
. 0 0 0 0 0 0 0 0 0 . 
0 0 0 0 0 0 0 0 0 0 0

Digit 9

You are given

N as input. Write a program to print the pattern of 2*N - 1 rows using an asterisk(*) 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,

N = 4.So, the output should be

* * * *
*     *
*     *
* * * *
      *
      *
* * * *



Sample Input 1

4

Sample Output 1

* * * *
*     *
*     *
* * * *
      *
      *
* * * 

Sample Input 2

5

Sample Output 2


* * * * * 
*       *
*       *
*       *
* * * * * 
        *
        *
        *
* * * * *




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

input-1

10

5

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




A college cafeteria manager conducted a survey to rate the quality of the food. A hundred students were asked using a scale of 1 to 10 with 1 being awful (bad) and 10 being excellent. Write a C++ program that stores the frequency of the students' answers in an integer array. The program should summarize the frequency for each rating in a report form. There are two display options the manager can display the report form or bar chart form.


How to make object as callable video __call__
from collections import Counter
class MyCounter(Counter):
Add here required code so that we can give data to object like co1("intel")
co1 = MyCounter()
co1("intel")

You must write a small application in JAVA that stores SRC candidate names and the votes they received. Your program must: 1. 2. Create an array of SRC candidate names. Populate the array with ten names. Create an array of votes. Populate the array with the number of votes for every candidate. The two arrays work in parallel. 3. 4. 5. Print the name of every candidate with his/her number of votes.  Print the total number of votes casted. Add votes for a specific candidate. a.


How to perform Sum and Difference in jQuery:


Write a C++ program to calculate the total marks of each student of a class. This class takes the following subjects Physics, Chemistry and Mathematics. Your program shall be able to calculate the total marks for each student,

Create a class named Marks with data members “student_number”, “name” and “mark”. Create three other classes inheriting the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in individual subject of each student. The student number of each student will be generated automatically starting with a prefix STDN followed by 5 integer numbers. The values of the 5 numbers shall be created in increasing order from 00000 to 99999. If a user enters a number larger the 99999 for the number of students in this class, a warning shall be given and program exits. The number of students in this class shall be entered by the user. When done, your program shall commit and print to a .txt file the name of the subject, the highest ranked student.
Create a function named DisplayNumberText to Display Number and Text input by user
LATEST TUTORIALS
APPROVED BY CLIENTS