Answer:
<em>#include <iostream></em>
<em>using namespace std;</em>
<em>//function definition</em>
<em>void send_variable(int num){</em>
<em> cout<<"The Number is "<<num<<endl;</em>
<em>}</em>
<em>// main function begins here</em>
<em>int main()</em>
<em>{</em>
<em> int x =15; //declares an it variable and assigns 15</em>
<em> // Calls the function send_variable</em>
<em> send_variable(x);</em>
<em> return 0;</em>
<em>}</em>
Explanation:
Using C++ programming language we created the function called send_variable and in the main function we call this function which only displays the value of an int variable passed unto it.
Answer:
system itself.
Explanation:
In Online Data Extraction data is extracted directly from the system itself.
Answer:
False
Explanation:
The private member of a class is not accessible by using the Dot notation ,however the private member are those which are not accessible inside the class they are accessible outside the class .The public member are accessible inside the class so they are accessible by using the dot operator .
<u>Following are the example is given below in C++ Language </u>
#include<iostream> // header file
using namespace std;
class Rectangle
{
private:
double r; // private member
public:
double area()
{ return 3.14*r*r;
}
};
int main()
{
Rectangle r1;// creating the object
r1.r = 3.5;
double t= r1.area(); // calling
cout<<" Area is:"<<t;
return 0;
}
Output:
compile time error is generated
<u>The correct program to access the private member of class is given below </u>
#include<iostream> // header file
using namespace std;
class Rectangle
{
private:
double r; // private member
public:
double area()
{
r1=r;
double t2=3.14*r2*r2;
return(t2); // return the value
}
};
int main()
{
Rectangle r1;// creating the object
r1.r = 1.5;
double t= r1.area(); // calling
cout<<" Area is:"<<t;
return 0;
}
Therefore the given statement is False
Begin
input value,
int a =value;
if a >=8 Or a<=15;
cout<<"Nice to see you!";
else
cout<<"Its time to go home!";
return 0;
End