मराठी

Write a program in Java to display the following pattern: A*B*C*D*EA*B*C*D*A*B*C*A*B*A* - Computer Applications

Advertisements
Advertisements

प्रश्न

Write a program in Java to display the following pattern:

A*B*C*D*E
A*B*C*D*
A*B*C*
A*B*
A* 

थोडक्यात उत्तर

उत्तर

public class Q12e{ 
public static void main(String args[]) 
{
s = "A*B*C*D*E*";
System.out.printIn("\n\n");
for (int i = s.length() - 1; i >= 0; i = i - 2)
{for (int j = 0; j <= i; j++)
System.out.print(s.charAt(j) + " ");

System.out.println();
}
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 2: Library Classes - EXERCISES [पृष्ठ १८०]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
पाठ 2 Library Classes
EXERCISES | Q VIII. 12. (e) | पृष्ठ १८०
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×