Can recursive programs be written in C++, Write a recursive program to calculate factorial in C++?
Submitted by: Administrator#include #include int fact (int ); void main() { int n, a; cout<<"enter any value"; cin>>n; a=fact(n); cout<< a; getch(); } int fact (int x) { if((x==0) || (x==1)) return 1; else return(x*(x-1)); }
Submitted by: Administrator
Submitted by: Administrator
Read Online Hardware and Software Design Job Interview Questions And Answers
Top Hardware and Software Design Questions
☺ | Explain Difference between RISC and CISC? |
☺ | What is a Turing machine? |
☺ | What is binary search, traversal, hashing? |
☺ | Explain Memory taken for char *, int * etc.? |
☺ | How does the browser know to go to a certain IP address when you enter a domain like globalguideline.com? |
Top PC Hardware Categories
☺ | Motherboard Interview Questions. |
☺ | Basic Computer Interview Questions. |
☺ | Embedded Systems Interview Questions. |
☺ | A + (Plus) Hardware Interview Questions. |
☺ | Computer Architecture Interview Questions. |