Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Recursive Functions
Recursion is a process by which a function includes itself with a condition for its safe exit. It is best suitable for a recursive problem. A typical example is the factorial problem, the programs without and with recursive functions are shown below.
void main()
{
long factorial ( int num); // Forward declaration of
//a function
int num;
printf("\n Enter a number:");
scanf("5d",&num);
printf(" Factorial of 5d is %ld",num,factorial(num));
}
long factorial(int num) // Non recursive
long f=1;
while ( n)
f = f * n;
n--;
return(f);
long factorial(int num) // Recursive
if(n == 1)
return (1);
else
return( n* factorial(n-1));
The default Constructor and Destructor If you fail to write a constructor and destructor function, the compiler automatically supplies them for you. These functions have publi
A function REPAT is specified below. Function REPAT(c in Char, i in Int, s in mString) return in mString pre 1 ≤ i ≤ the length of s. post The returned value is a string identic
Determine the size of an interger data type without using sizeof() function? A: #include int main() { int *i ; int *j = i + 1; cout }
Define One's Complement Operator? The one's complement operator, occasionally called the "bitwise NOT" or "bitwise complement" operator produces the bitwise one's complement of
Define the Float Data Type of c Language? The float is used to define floating point numbers. The Floating point numbers are stored in 32 bits with 6 digits of precision. Eg
How can one make it so keys pressed through users are not echoed on the screen? A: It is not a standard C++ feature. C++ doesn't even need your system to have a keyboard or a sc
Problem: a) Give and Illustrate with the help of diagrams, four topologies for the Network Information System (NIS). b) Give methods for creating user accounts and groups.
Can I explicitly call a destructor if I've allocated my object with new?
programme for time table in c++
A game is played with three piles of stones and two players. At her turn, a player removes one or more stones from the piles. However, if she takes stones from more than one pile,
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd