write a program to print the following pattern of blue j. please give me the correct answer my exams are near .
Attachments:
![](https://hi-static.z-dn.net/files/d1d/0ed1a2d4a6728dab199c7ad43142e2e8.jpg)
Answers
Answered by
6
Answer:
This can be solved using charAt( )
______________
Note:-
- charAt() is used for extracting the charter at a particular position(here,index of string)
- String index starts from 0 to n-1 where n is the no. of characters. This is the reason why loop is starting from 0.
- print() will print in same lines
- println() will print in different lines
________
Variable Description:-
- str:- to store string data
- i:- loop variable
- j:- loop variable
_
•Output Attached
Attachments:
![](https://hi-static.z-dn.net/files/d51/6255438ac5fd212538de5181da5abab8.jpg)
![](https://hi-static.z-dn.net/files/d31/35c342a28745b1ea6b93491fc229afa1.jpg)
Answered by
6
Attachments:
![](https://hi-static.z-dn.net/files/d8c/40984417899b4c997072f14d3b4b03c6.png)
![](https://hi-static.z-dn.net/files/d6c/4d76dce04ea0ccea32cf45ecee1d96d3.png)
![](https://hi-static.z-dn.net/files/d63/1ab6a46cea3f8376ecf999877ad5c8c5.png)
Similar questions