Question: plz use java Assume we have already defined a variable of type int called num with the following line of code: int num = ???;

plz use java Assume we have already defined a variable of typeplz use java

Assume we have already defined a variable of type int called num with the following line of code: int num = ???; // 'num' can have any int value TASK: Print a centered triangle with num asterisks (*) on the bottom row, num - 2 asterisks on the next bottom row, ..., and 1 asterisk on the top row, where the triangle is surrounded by hyphens (-). You can assume that num is odd and is at least 3. EXAMPLE: If num is 5, the resulting triangle would be the following: 1 1 * * * Sample Input: 5 Sample Output: T ***- * Write a program, test using stdin stdout Time limit: 8 seconds Memory limit: 256 MB

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!