write a program to display the the given pattern 11111 3333 555 77 9
atrs7391:
Programming language?
Answers
Answered by
10
Correct Question:-
- Program to display the following pattern:-
11111
3333
555
77
9
- Co de language:- Not mentioned
This is a very easy Question!! here is your answer...done in QBASIC, JAVA, Python.
Qbasic Program :-
CLS
FOR I=1 TO 9 STEP 2
FOR J=9 TO I STEP -2
PRINT J
NEXT J
NEXT I
END
Java Program :-
package Co der;
import java.util.*;
public class pattOdd
{
public static void main (String ar [])
{
for(int I=1 ; I<=9; I+=2)
{
for(int j=9 ; j>=I; j-=2)
{
System.out.print(I);
}
System.out.println();
}
}
}
•Java Output Attached
Attachments:
Similar questions
Social Sciences,
1 month ago
Science,
1 month ago
Math,
3 months ago
History,
3 months ago
Physics,
9 months ago