Wipro NLTH Pattern Making Questions

Ques. Programming Pattern to Print 2*N Number of rows for input Pattern?

3
44
555
6666
555
44
3

 

2 comments on “Wipro NLTH Pattern Making Questions”


  • Sagar

    import java.util.*;
    public class main {
    public static void main(String args[])
    {
    Scanner sc=new Scanner(System.in);
    int num=3;
    for(int i=1;i<=4;i++)//loop for printing till line 4
    {
    for(int j=0;j=1;i–)//loop for printing from line 5 to 7
    {
    for(int j=0;j<i;j++)
    {
    System.out.print(num2);
    }
    System.out.print("\n");
    num2–;
    }
    }
    }


  • Alok

    #include
    using namespace std;

    int main() {
    int n;
    cin>>n;
    int m=n;

    for(int i=0; i<n+1; i++)
    {
    for(int j=0; j<=i; j++)
    cout<<m;
    m++;
    cout<=0; i–)
    {
    m–;
    for(int j=0; j<=i; j++)
    cout<<m;
    cout<<endl;
    }
    return 0;
    }