Java Question For Absolute Beginner
Java Question For Absolute Beginner
INDEX
INDEX 1
Input Format
Output Format
Sample Input 0
Sample Output 0
*****
Sample Input 1
Sample Output 1
*******
Sample Input 2
Return to index
Input Format
Output Format
Sample Input
Sample Output
***
***
***
Return to index
Input Format
Output Format
Sample Input 0
4
4
Sample Output 0
****
****
****
****
Sample Input 1
6
5
Sample Output 1
******
******
******
******
******
Return to index
Input Format
Output Format
Sample Input
Sample Output
*
**
***
****
*****
Input Format
Output Format
5 *****
****
***
**
*
Return to index
Input Format
Output Format
Sample Input 0
Sample Output 0
*
**
***
****
*****
Input Format
Output Format
5 1
12
123
1234
12345
Return to index
Input Format
Output Format
5 1
12
123
1234
12345
Input Format
Output Format
Sample Input
Sample Output
1234567
123456
12345
1234
123
12
1
Return to index
Input Format
Output Format
Sample Input
Sample Output
5
5 10
5 10 15
5 10 15 20
5 10 15 20 25
5 10 15 20 25 30
Return to index
Then print a hollow star rectangle which has m stars in the first line and m stars in the nth line.
Their rectangle should have n lines and every line in between should have only the first star and
then the mth star.
Input Format
For each test case, m will be given in the first line. And n will be given in the second line.
Output Format
Sample Input 0
5
4
Sample Output 0
*****
* *
* *
*****
Sample Input 1
7
8
Sample Output 1
*******
* *
* *
* *
* *
* *
* *
*******
Return to index
In the first line there will a star , followed by n-2 spaces and then there will be a star again,
Just like above, there will be n-1 lines and then in the last line there will be n stars.
Input Format
Output Format
Sample Input
Sample Output
* *
* *
* *
* *
*****
Example: n=5
Input Format
Output Format
Return to index
Input Format
Output Format
Sample Input
Sample Output
*
**
***
****
*****
Return to index
Input Format
Output Format
Sample Input
Sample Output
*
***
*****
*******
*********
*******
*****
***
*
Return to index
Take m as an integer input, where m tab separated stars are printed in the first line. Then you have
to print the pattern below.
Input Format
Output Format
Sample Input 0
Sample Output 0
* * * * *
* * *
*
Sample Input 1
Sample Output 1
* * * * * * * * *
* * * * * * *
* * * * *
* * *
*
Return to index
Input Format
Output Format
3 Sample Output 0 5 * * * * *
10 13 * *
* * * * *
* * * * * * *
* * * *
* * * * *
* * * * * * *
* * * *
* * * * *
* * * * * * *
* * * *
* * * * *
* * * * *
Return to index
Eg. for m=7, the output is written under. Recognise the pattern and print the final output.
Input Format
Output Format
Sample Input 0
7
Sample Output 0
* *
* *
* *
*
Sample Input 1
5
Sample Output 1
* *
* *
*
Sample Input 2
9
Sample Output 2
* *
* *
* *
* *
*
Return to index
Input Format
Output Format
Sample Input
Sample Output
* * * * * * * * *
* * * * * * *
* * * * *
* * *
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
Return to index
Input Format
Output Format
Sample Input
6
7
Sample Output
7
7 14
7 14 21
7 14 21 28
7 14 21 28 35
7 14 21 28 35 42
Explanation
Return to index
****1
***12
**123
*1234
12345
Input Format
Output Format
Sample Input
Sample Output
*****1
****12
***123
**1234
*12345
123456
Return to index
****1
***21
**321
*4321
54321
Input Format
Output Format
Sample Input
Sample Output
*****1
****21
***321
**4321
*54321
654321
Return to index