Chapter:

Recursive-program-in-c

C Program to Find Product of 2 Numbers using Recursion

Problem Description

This C program finds the product of 2 numbers using recursion.

Problem Solution

This C program using recursion, finds the product of 2 numbers without using the multiplication operator.

Program/Source Code

#include <stdio.h>

 

int product(int, int);

 

int main()

{

    int a, b, result;

 

    printf("Enter two numbers to find their product: ");

    scanf("%d%d", &a, &b);

    result = product(a, b);

    printf("Product of %d and %d is %d\n", a, b, result);

    return 0;

}

 

int product(int a, int b)

{

    if (a < b)

    {Show More

All Chapters

View all Chapter and number of question available From each chapter from C-programming-