-6

what is the source code having an output of
1
21
321
using for loop statement in microsoft visual c++?

it must be right aligned

Edited by Nick Evan: n/a

Votes + Comments
No coding!!!!!!
Try something by ownself.
4
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by Onlineshade
-7
#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
	int i,j,k;

	for ( i=1; i<5; i++ )
	{
		for ( j=0,k=i ; j<i ; j++,k--  )
		{
			cout << k;
		}
		cout << "\n";
	}

	char f;cin>>f;
	return 0;
}

Is this good for you, or did you wanted something else?

Edited by nuclear: n/a

Votes + Comments
Dont directly post the code. Please!
dont do home Work for others
You forgot to ask if he wants fries with that.
Do not give code directly.Please give a chance him to try some code.
Way to go! Now he doesn't have to think nor learn how to program! Good job!
1

No it's not good. Doing his homework for him is NOT good. It's called cheating, something we try to avoid on these forums.

0

No it's not good. Doing his homework for him is NOT good. It's called cheating, something we try to avoid on these forums.

Just thought it would be easier if i show the guy how its done and then if he really likes what hes doing, he would try and understand how i did that himself. But yeah, i get the point, it was stupid of me to do it for him, thanks for informing me. :)

-1

The logic of your actual post is almost same to print pyramid. Please do some coding.

Votes + Comments
Don't make a second post when you can edit your first post!
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.