20. Write a program to find factorial of a given number. Throw multiple exceptions and define multiple catch statements to handle negative number andout of memory exception. Negative number exception thrown if given number is negative value and out of memory exception is thrown if the given number is greater than 20 # include<iostream> using namespace std; int main() { int n,i,f=1; cout<<"\n enter a number"; cin>>n; try { if(n>0&&n<20) { for(i=1;i<n+1;i++) f=f*i; cout<<"the factorial is"<<f; } ...
Engineering Text Books , Ebooks , C Programs , C++ Programs at one single stop