- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

In this tutorial, we will be discussing a program to find the number of possible paths from top left to bottom right of a mXn matrix.

For this we will be provided with a mXn matrix. Our task is to find all the possible paths from top left to bottom right of the given matrix.

#include <iostream> using namespace std; //returning count of possible paths int count_paths(int m, int n){ if (m == 1 || n == 1) return 1; return count_paths(m - 1, n) + count_paths(m, n - 1); } int main(){ cout << count_paths(3, 3); return 0; }

6

- Related Questions & Answers
- Print all possible paths from top left to bottom right of a mXn matrix in C++
- Print all palindromic paths from top left to bottom right in a matrix in C++
- Print all paths from top left to bottom right in a matrix with four moves allowed in C++
- Maximum points from top left of matrix to bottom right and return back in C++
- Set the left, right, top and bottom padding of an element
- Program to count number of walls required to partition top-left and bottom-right cells in Python
- Count all possible paths between two vertices in C++
- Maximum sum path in a matrix from top to bottom in C++
- How to display the JList items from top to bottom and left to right in Java?
- Print a matrix in alternate manner (left to right then right to left) in C++
- Maximum sum path in a matrix from top to bottom in C++ Program
- Program to find number of ways we can reach from top left point to bottom right point in Python
- How to add a straight line to a plot in R starting from bottom left and ending at top right?
- Print all leaf nodes of a binary tree from right to left in C++
- Maximum sum path in a matrix from top to bottom and back in C++ Program

Advertisements