HOME Forums Forum Nested loop

This topic contains 2 replies, has 1 voice, and was last updated by  Voeurn Sothavith 1 year, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #886 Reply

    Voeurn Sothavith
    Any one have diffrent idea?(This problem is solved)
    
    N=5
    
    1
    2  3
    4  5  6
    7  8  9  10
    11 12 13 14 15
    :)
    
    #888 Reply

    Pon Koemse
    #include<iostream.h>
    #include<conio.h>
    void main()
    {
    	int n,m=1;
       	cout<<"Enter N : "; cin>>n;
       	for(int i=1;i<=n;i++)
       	{
       		for(int j=1;j<=i;j++)
         		{
          			cout<<m<<" ";
            		 m++;
         		}
         		cout<<endl;
       	}
    	getch();
    }
    
    
    
    		
    	
    #889 Reply

    Voeurn Sothavith

    Same Same 😎

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Nested loop
Your information: