wikki2013's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
3 (0 per day)
Joined:
15-January 13
Profile Views:
102
Last Active:
User is offline May 26 2013 05:30 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   wikki2013 has not set their status

Posts I've Made

  1. In Topic: Trouble in required output

    Posted 15 Jan 2013

    View Postmojo666, on 15 January 2013 - 04:21 PM, said:

    The J loop is contolling the row output

    for(int j = 1; j<=i; j++)
    


    As written it starts at 1 and increases to i. Change it to start at i and decrease to 1.


    Thank you very much. I couldn't imagine it was so simple. Thank you, once again. Long live programming. LOLZ
  2. In Topic: Trouble in required output

    Posted 15 Jan 2013

    Okay! I have now completed the program with the hints you have given.
    I have this program, it also requires a valid output;
    	#include <iostream>
    	#include <conio.h>
    	using namespace std;
    	 
    	void main()
    	{
    	    int number;
    	    int temp;
        cout << "Enter a number: ";
    	    cin >> number;
    	    temp = number;
    	    for (int i = 1; i <= number; i++)
    	    {
    			for (int k = temp; k>=1; k--)
    				cout << " ";
    	        for (int j = 1; j<=i; j++)
    	            cout <<  j << " ";
    	        temp--;
    	        cout << endl;
    	    }
    	    getch();
    	}
    
    

    This program prints the following output:

    .........1
    .......1 2
    ....1. 2.. .3
    . .1.. 2. . 3. . 4.
    1. 2. . 3. 4. .5

    {excluding the points, )

    Now i want this input like this;

    .........1
    .......2 1
    ....3. 2.. .1
    . .4.. 3. . 2. . 1.
    5. 4. . 3. 2. .1

    I hope you can help me solve this issue on your earliest. Regards.

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

wikki2013 hasn't added any friends yet.

Comments

wikki2013 has no profile comments yet. Why not say hello?