tcoma4x4 -4 Newbie Poster

Hi All,

I have this old c program that I did a while back on pascals triangle and i'm trying to convert it over to c#.net. Can anyone help me do this? I do not know much or anything on on c#

Here is the code:

//Lyncob directory
#include <stdio.h>
#include <stdlib.h>
int main()
{
int numberOfLevels, i, j , k, spaces = 5;
printf ( "How many rows you want to show?: ");
scanf ( "%d", & numberOfLevels);
for ( i = 0; i < numberOfLevels; i ++ ) 
{
int currentElement = 1;
k = 0;
while ( k < spaces )
{
printf ( " " );
k ++;
}
for ( j = i; j >= 0; j -- ) 
{
printf ( " %d", currentElement );
currentElement = currentElement * j / ( i - j + 1 );
}
printf("\n");
spaces --;
}
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.