Jail time since you can be considered a spy or a perv. Whatever you aim is of course.
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:
A.Un hacker introduce un cadru fals în timpul transmiterii datelor.
Explanation:
<span>Write a program that prints ‘Hello World’ to the screen.Write a program that asks the user for her name and greets her with her name.Modify the previous program such that only the users Alice and Bob are greeted with their names.<span>Write a program that asks the user for a number n and prints the sum of the numbers 1 to n</span><span>Modify the previous program such that only multiples of three or
five are considered in the sum, e.g. 3, 5, 6, 9, 10, 12, 15 for n=17</span><span>Write a program that asks the user for a number n and gives him the possibility to choose between computing the sum and computing the product of 1,…,n.</span>Write a program that prints a multiplication table for numbers up to 12.<span>Write a program that prints all prime numbers. (Note: if
your programming language does not support arbitrary size numbers,
printing all primes up to the largest number you can easily represent is
fine too.)</span>Write a guessing game where the user has to guess a secret number.
After every guess the program tells the user whether their number was
too large or too small. At the end the number of tries needed should be
printed. I counts only as one try if they input the same number multiple
times consecutively.<span>Write a program that prints the next 20 leap years.</span></span>