Interview Questions  

Go Back   Interview Questions > Interview Questions & Answers > Code Snippets > Programming Code > Dot Net Code > C Sharp Code

C Sharp Code C Sharp Code Interview Questions, Learn by sharing C Sharp Code Interview Questions asked in various Companies, Get Career advices, Interview Procedures from C Sharp Code experts, Post asked C Sharp Code Interview Questions and Answers.

   

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-19-2008, 10:53 AM
Senior Member
 
Join Date: Mar 2008
Posts: 351
Default Write C sharp code for factorial using static

Write C sharp code for factorial using static variables ?
Reply With Quote
  #2 (permalink)  
Old 11-18-2008, 03:15 PM
Junior Member
 
Join Date: Nov 2008
Posts: 1
Default

int fact(int);
void main()
{
int no,a;
console.writeLine("Enter the Number...");
console.readLine("{0}",a);
a=fact(no);
console.WriteLine("Result is{0}",a);

}
int fact(j)
{
int i,f=0;
for(i=0;i<=j;i++)
{
f=f*i;

}
return(f);
}
Reply With Quote
Reply

Tags
c sharp code, c sharp coding, c sharp programs

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On