Answer:
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
// recursive function to find sum from 1 to n
int recur_Sum(int n)
{ // base condition
if (n <= 1)
return n;
// recursive call
return n + recur_Sum(n - 1);
}
// main function
int main()
{
// variables
int n;
cout<<"Enter a number:";
// read the number
cin>>n;
// print the sum
cout<<"Sum of first "<<n<<" integer from 1 to "<<n<<" is:"<<recur_Sum(n);
return 0;
}
Explanation:
Read a number from user and assign it to variable "n".Call function recur_Sum() with parameter "n".This function will recursively call itself and find the Sum of first n numbers from 1 to n.Then function will return the sum.
Output:
Enter a number:10
Sum of first 10 integer from 1 to 10 is:55
A relative URL is a type of URL that gives an abbreviated path to a resource by using the current webpage as a starting position.
<h3>What is a
relative URL?</h3>
A relative URL can be defined as a type of URL that doesn't contain or use the full address of a website, but only the path (location) following the domain name.
This ultimately implies that, a relative URL is a type of URL that gives an abbreviated path (location) to a web resource by using the current webpage as a starting position.
Read more on relative URL here: brainly.com/question/26670945
#SPJ12
Answer:
In an 802.11, a master device in a bluetooth network organize themselves into a "Piconet" of up to 8 slave devices. In an 802.11, a base station is a receiver and transmitter that plays a role of the WIFI network.
Explanation:
802.11 is the original wireless specification and it was developed by IEEE. IEEE stands for Institute of Electrical and Electronic Engineers (IEEE).
In an 802.11, a master device in a bluetooth network organize themselves into a "Piconet" of up to 8 slave devices. In an 802.11, a base station is a receiver and transmitter that plays a role of the WIFI network.
In the program While loop is used. In the while loop it divides the userNum by 2 in each iteration and prints the value of userNum. The inputs and corresponding outputs are written in the explanation.
<u>Explanation</u>:
In the while loop it divides the userNum by 2 in each iteration and prints the value of userNum.
import java.util.Scanner;
public class NonNegativeLooper
public static void main (String [] args)
Scanner scnr = new Scanner(System.in);
//initialize the userNum with 9
int userNum = 9;
//Repeat the loop until the userNum is not negative
while (userNum>=0)
System.out.println(Body);
//Prompt the user to enter the usrNum again
userNum = scnr.nextInt();
System.out.println(Done.);
return;