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
The first line of input is an integer
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
The first line of input is an integer
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
The first line of input is an integer
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.
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: