TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Bing In
NA
30
8.9k
method problems
Apr 18 2016 5:49 AM
I want to calculate a factorial(n!) input as an interger "n"
I found there is an error at Fact(n);
error says
The name 'n' does not exist int the current context
what`s wrong with the n in Fact() method?
public static void Main()
{
Console.WriteLine("Type an integer");
string factorial = Console.ReadLine();
Fact(n);
}
public static void Fact(int n)
{
if (n == 0)
{
n = 1;
}
else if (n >= 1)
{
for (int i = 1; i < n; i++)
{
n = n * i;
}
}
Reply
Answers (
1
)
I want code mult and det a×b matrix windwos form
What means "I" in c#?