interview questions and answers

Technical Interview Questions | DataStructure Interview Questions

Home interview questions Programming interview questions DataStructure 
Saturday, 11 February 2012
Main Menu
Home
Online Test
Contest
Search
FAQs
Contact Us
Login
Most Popular Category
JAVA

Microsoft Technologies
ASP, C#, DotNet, ...

Programming
C++, PHP, VB, ...

SAP

Testing

Web Technologies

Polls
Does personal networking help in job search?
 
IT Placement Papers interview questions Programming interview questions DataStructure

This category contains DataStructure Interview Questions and Answers


Find the factorial of number

PDF Print E-mail


//
    // recursive version
    //

    int Factorial( int Num )
    {

    If ( num > 0 )
    return Num * Factorial ( Num –1 );
else
    return 1;
}


//
// iterative version
//

    int Factorial( int Num )
    {
    int I
    int result = 1;
   
for ( I= Num; I > 0; I-- )
{
    result = result * I;
}

return result;
}






Be first to comment this article

Only registered users can write comments.
Please login or register.

 
< Prev   Next >

Technical Interview Questions | DataStructure Interview Questions

Top!
Top!
Copyright © 2008 InterviewDuniya.com All Rights Reserved.
Partner Site: Maheshwari Matrimony