Answer:
4 bits
Explanation:
With 4 bits you can count to 15, because 2⁴=16. The maximum number you can express is always one less, i.e., 16-1=15.
In general, with n bits you can count to 2ⁿ-1.
Answer:
Following are the program to this question:
#include <iostream>//defining header file
using namespace std;
int recurs(int x, int n)//defining a method recurs that accepts two parameter
{
if(n==0)//defining if block that checks n value
{
return 1;//return value 1
}
else//defining else block
{
return x*recurs(x,n-1);//use return keyword that retun value
}
}
int main()//defining main method
{
cout<<recurs(5,3); //use print method to call recurs method
return 0;
}
Output:
125
Explanation:
In the above-given program, the integer method "recurs" is declared which accepts, two integer variables, which are "x, n", inside the method the if conditional statement is used.
- In the if block, it checks the value of n is equal to "0" if this condition is true, it will return a value, that is 1.
- Otherwise, it will go to the else block, in this block, it will use the recursive method to print its value.
Answer:
Explained
Explanation:
The three characteristics of an object
Encapsulation: It is the process of capturing data and securing it for safety from the outside interfaces. Binding data and operations of data into a single unit.
Inheritance: This is the process by which a class can be derived from the base class, with all features of base class and some of its own. This increases data reusability.
Abstraction: The ability to represent data at very basic level without showing the details of it is called abstraction.
Answer:
Privacy
Explanation:
I'm not sure but it matches the description you gave.