Register Login

Login with your site account

Lost your password?

Not a member yet? Register now

WebclassesWebclasses
  • Home
  • Courses
    • Start Learning Here

      • Learn HTML
      • Learn CSS
      • Learn PHP
      • Learn JS
      • Learn SQL
      • Learn C
      • Learn C++
      • Learn 8051

      New Course

      8051 Micro-controller

      8051 Micro-controller

      Free
      Read More
  • Blog
  • Contact Us
    • Home
    • Courses
      • Start Learning Here

        • Learn HTML
        • Learn CSS
        • Learn PHP
        • Learn JS
        • Learn SQL
        • Learn C
        • Learn C++
        • Learn 8051

        New Course

        8051 Micro-controller

        8051 Micro-controller

        Free
        Read More
    • Blog
    • Contact Us
    • Home
    • All courses
    • C Programming

    C Programming

    mahethekiller
    (0 review)
    Free
    C Programming

    C Recursive Functions

    • Recursion is a process by which a function calls itself repeatedly, until some specified condition has been satisfied.
    • The process is used for repetitive computations in which each action is stated in terms of a previous result.
    • In order to solve a problem recursively, two conditions must be satisfied.
    • First, the problem must be written in a recursive form, and second, the problem statement must include a stopping condition
    Example:

    Suppose, for example, we wish to calculate the factorial of a positive integer quantity.

    We would normally express this problem as:

     n! = 1 × 2 × 3 × . . . . × n

    where n is the specified positive integer

    However, we can also express this problem in another way by writing:

    n! = n × ( n – 1 ) !

    • This is a recursive statement of the problem, in which the desired action ( the calculation of n!) is expressed in terms of a previous result [ the value of ( n-1 )!, which is assumed to be known].
    • Also, we know that 1! = 1, by definition.
    • This last expression provides a stopping condition for the recursion.
    Calculating Factorial Using Recursion
    # include <stdio.h>
    
    long int factorial ( int n) {
    	
    	if ( n <= 1)
    	
    	return 1;
    	
    	else
    	
    	return ( n * factorial ( n – 1 ));
    	
    }
    
    void main ( void ) 
    
    {
    	
    	printf ( “\n 5! = %ld”, factorial(5)); 
    	
    }

     

    Prev C Calling Functions
    Next C Arrays
    • Description
    • Curriculum
    • Instructors
    • Reviews (0)

    C  is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, and therefore it has found lasting use in applications that had formerly been coded in assembly language, including operating systems, as well as various application software for computers ranging from supercomputers to embedded systems.

    C was originally developed by Dennis Ritchie between 1969 and 1973 at Bell Labs, and used to re-implement the Unix operating system. It has since become one of the most widely used programming languages of all time, with C compilers from various vendors available for the majority of existing computer architectures and operating systems. C has been standardized by the American National Standards Institute (ANSI) since 1989 and subsequently by the International Organization for Standardization (ISO).

    Course Features

    • Lectures 19
    • Quizzes 0
    • Duration 50 hours
    • Skill level All levels
    • Language English
    • Students 2
    • Certificate No
    • Assessments Self
    • Share:
      • Lecture1.1
        C Overview
        0m
      • Lecture1.2
        C – Environment Setup
        0m
      • Lecture1.3
        C Data Types
        0m
      • Lecture1.4
        C Operators and Expressions
        0m
      • Lecture1.5
        C Type Conversion
        0m
      • Lecture1.6
        C Standard I/O Functions
        0m
      • Lecture1.7
        C Formatted I/O Functions
        0m
      • Lecture1.8
        C Unformatted Input Output Functions
        0m
      • Lecture1.9
        C Decision Making Statements
        0m
      • Lecture1.10
        C Loops
        0m
      • Lecture1.11
        C break statement in C
        0m
      • Lecture1.12
        C Functions
        0m
      • Lecture1.13
        C Calling Functions
        0m
      • Lecture1.14
        C Recursive Functions
        0m
      • Lecture1.15
        C Arrays
        0m
      • Lecture1.16
        C Structures
        0m
      • Lecture1.17
        C Unions
        0m
      • Lecture1.18
        C File Handling
        0m
      • Lecture1.19
        C Dynamic Memory Allocation, Memory Leak
        0m
    mahethekiller

    Reviews

    Average Rating

    0
    0 rating

    Detailed Rating

    5 stars
    0
    4 stars
    0
    3 stars
    0
    2 stars
    0
    1 star
    0

    You May Like

    8051 Micro-controller Read More
    mahethekiller

    8051 Micro-controller

    50
    0
    Free
    C ++ Programming Read More
    mahethekiller

    C ++ Programming

    20
    0
    Free
    SQL Programming Read More
    mahethekiller

    SQL Programming

    0
    0
    Free

    Leave A Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    Latest Courses

    8051 Micro-controller

    8051 Micro-controller

    Free
    Javascript Programming

    Javascript Programming

    Free
    C ++ Programming

    C ++ Programming

    Free

    Recent Posts

    • How to Create a Basic CRUD application Using PHP and MySql
    • Login And Logout Script using PHP Sessions
    • How to Upload an image using Ajax and PHP

    Courses

    • HTML
    • CSS
    • Javascript
    • PHP

    Advanced

    • SQL
    • C Programming
    • C++ Programming
    • 8051 Microcontroller

    Links

    • Home
    • Blog
    • Courses

    Webclasses