• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

SoftwareTestingo - Interview Questions, Tutorial & Test Cases Template Examples

SoftwareTestingo - Interview Questions, Tutorial & Test Cases Template Examples

  • Home
  • Test Case Examples
  • Interview Questions
  • Interview Questions Asked
  • Java
  • Selenium
  • Manual Testing
  • SQL Tutorial For Beginners
  • Difference
  • Tools
  • Contact Us
  • Search
SoftwareTestingo » Manual Testing » Test Cases Example » Test Cases For Factorial Program

Test Cases For Factorial Program

Last Updated on: April 9, 2023 By Softwaretestingo Editorial Board

What We Are Learn On This Post

  • Test Case For Factorial

Test Cases For Factorial Program: n! means n(n-1)(n-2)……3,2,1 First, Check the given integer is positive. If the given integer is negative,n! is not defined; if the given number is a fraction,n! Is not defined, check the given number is 0,n! is 1hope I’ll get an idea…if any wrong with this….correct me.

Post On:Test Cases For Factorial Program
Post Type:Test Case Template
Published On:www.softwaretestingo.com
Applicable For:Freshers & Experience
Get Updates:SoftwareTestingo Group Link

n! :n(n-1)(n-2)…..3,2,1.First TC: Check the given integer is positive. If the given number is negative, ExpectedResult: n! is not defined If the given integer is a fraction. n! is not defined TC: check the given number is 0 (0!=1) ER: 1 is displayed Hope I’ll get an idea…correct if it’s wrong

Factorials are represented by n!

Examples:

3! = 1 * 2 * 3 = 6
4! = 1 * 2 * 3 * 4 = 24
5! = 1 * 2 * 3 * 4 * 5 = 120

A factorial program is easy to test because you test the input value for an integer variable related to a single text box and then verify its output value.  Here are the test cases:

Test Cases Template
Java Interview Questions Basic
SQL Queries Practice For Interview
Selenium Tricky Interview Questions
DevOps Interview Questions
Database Testing Interview Questions
Triangle Test Cases
Test Cases Addition Of Two Numbers
Estimated Time Of Arrival Formula
API Test Cases In Excel

Test Case For Factorial

Determine the maximum integer value that the computer can calculate in its factorial.  This value becomes the upper boundary.

Positive Test Cases

  • Submit integer value at lower boundary [ 0 ]
  • Submit integer value at lower boundary +1 [ 1 ]
  • Submit integer value at the upper boundary -1
  • Submit integer value at the upper boundary

Negative Test Cases

  • Submit integer value at upper boundary +1
  • Submit integer value with leading 0
  • Submit integer value with leading plus sign [+]
  • Submit integer value with the leading minus sign [-]
  • Submit integer value with leading space
  • Submit a number with a decimal point
  • Submit a number with the letter ‘e’ in it
  • Submit alpha character(s)
  • Submit special character(s) [ex: !@#$^]
  • Submit with only space
  • Submit with nothing entered

The Factorial of a given number should not be negative numbers, decimal point numbers, alpha characters, or special characters, and if it is a function, it takes only one parameter.

    Filed Under: Test Cases Example

    Reader Interactions

    Comments

    1. Avatar for MeroeduMeroedu says

      August 18, 2019 at 3:30 PM

      Thanks for the information

      Reply

    Leave a Reply Cancel reply

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

    Primary Sidebar

    Join SoftwareTestingo Telegram Group

    Categories

    Copyright © 2023 SoftwareTestingo.com ~ Contact Us ~ Sitemap ~ Privacy Policy ~ Testing Careers