## yayaza

Set factorial to 1
While N is not equal to 0
Set factorial=factorial*N
Set N= N-1
End While
Display factorial

## finito 46

What have you done so far? in codeing that is

## yayaza

what i have done is this:

String factorial;//declare variable factorial

``````factorial=1;
While N != 0
{
factorial*N=factorial;
N--;
}

DisplayLabel.Text=factorial.ToString``````

## apegram 302

Where is the user input?
Why is factorial a string?
Why are you assigning an integer to a string?
That while statement won't compile.
The factorial assigment statement is incorrect.
The final statement will not compile.

## yayaza

Then may i know what is the right way to do please?

## finito 46

Where is the user input?

Where is N defined, N is the input
Get the input from the user.

Why is factorial a string?

Make factorial an integer

Why are you assigning an integer to a string?

I think he was saying why are you assigning it as string where it should have been an integer

That while statement won't compile.

The factorial assigment statement is incorrect.

factorial*N=factorial; where did you learn programming man?
its factorial = ;

The final statement will not compile.

You are missing a ;

did you try to compile this?

I can see you are very new to programming. Which is OK, please tell me if you need further clarification.

## yayaza

thanks fpr helping and ya im very new to programming.just started 2 weeks ago.i need great help...im like cracking my head on how to programming the right way for certain applications right now.

## finito 46

ok please mark as solved if solved.

## yayaza

Visual studio still does'nt run this program right.what is wrong with my code.what can i do to run the program well?

this is what i added in the coding:

``````    private void button1_Click(object sender, EventArgs e)
{
int factorial;
factorial=1;

While (N != 0);
{
factorial= factorial*N;

N--;
}
factorialDisplay.Text = factorial.ToString;
``````

## finito 46

you haven't initialized N.

factorialDisplay.Text = factorial.ToString();

What is the Error. If you read it you should be able to tell.