1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nady [450]
3 years ago
14

Questions: 1) Run the C program, attach a screenshot of the output in the answer sheet. 2) Check the address of the array and th

e address of the first element in the array printed out using method 1. Are they the same? If yes, please explain why. 3) Check the addresses of the elements in the array printed out using method 1 and method 2 separately. Are they the same? If yes, please explain why. 4) Write down the statement to print out the length of the array by using sizeof operator. 5) If array numbers is passed to a function, can we still use the sizeof operator to obtain the length the array numbers in that function? If not, please explain why.
Computers and Technology
1 answer:
KiRa [710]3 years ago
5 0

Answer:

Output

mumners = 0x7ffc4d2767d0

Method1: Address of array Elements

numbers[0] = 0x7ffc4d2767d0

numbers[1] = 0x7ffc4d2767d4

numbers[2] = 0x7ffc4d2767d8

numbers[3] = 0x7ffc4d2767dc

numbers[4] = 0x7ffc4d2767e0

Method2: Address of array Elements

numbers[0] = 0x7ffc4d2767d0

numbers[1] = 0x7ffc4d2767e4

numbers[2] = 0x7ffc4d2767f8

numbers[3] = 0x7ffc4d27680c

numbers[4] = 0x7ffc4d276820

sizeof(numbers) = 20

2.

mumners = 0x7ffc4d2767d0

Method1: Address of array Elements

numbers[0] = 0x7ffc4d2767d0

Yes both are same since address of the array is the address of its first element

3.

Method1: Address of array Elements

numbers[0] = 0x7ffc4d2767d0

numbers[1] = 0x7ffc4d2767d4

numbers[2] = 0x7ffc4d2767d8

numbers[3] = 0x7ffc4d2767dc

numbers[4] = 0x7ffc4d2767e0

Method2: Address of array Elements

numbers[0] = 0x7ffc4d2767d0

numbers[1] = 0x7ffc4d2767e4

numbers[2] = 0x7ffc4d2767f8

numbers[3] = 0x7ffc4d27680c

numbers[4] = 0x7ffc4d276820

Address printed using Method1 and Method2 are same since name of the array itself a pointer and adding 1 to it gives second element address and 2 to it gives third element and so on similarly applying address operator over the array elements provides the direct address of the element.

4.

printf("Length(numbers) = %lu\n",sizeof(numbers)/sizeof(numbers[0]));

Dividing an size of array by size of individual array elements gives length of an array

Length(numbers) = 5

5.

Yes even if numbers are passed to a function sizeof can be applied since numbers is starting address of an array and to pass an array as argument its address passed.

You might be interested in
Ranges of IP address that anyone can use for their internal networks are known as ______.
Rama09 [41]
Since no answer choices, have to deduce it is Private Networks
8 0
3 years ago
Read 2 more answers
Universal Containers has a requirement to integrate Salesforce with an external system to control record access. What option sho
Inessa05 [86]

Answer:

C. Use the SOAP API to maintain the related SObject_share records

8 0
3 years ago
1) Which of the following would you NOT see on a Windows 10 Start menu?
Sati [7]
Task view

I hope this helps you :)
3 0
3 years ago
Overloading in methods are popular in programming, and why overloading is important.
Cerrena [4.2K]

Answer:

 Yes, overloading is one of the methods which are popular in programming language. Overloading basically refers to the same function but different signature called function overloading or method overloading. It is the ability to define the multiples method by using the single identifier.

The overloading is important because it has the ability to design the multiple method by using similar name. It also provide the high flexibility to the programmers to call the same method in the data. overloading basically provide the high clarity in the code.

Overloading is used to achieved the compile time polymorphism.  

Following are program of function overloading in c++ are:

Class abc // creating class

{

public:

int p;

void fun() // function fun with no parameter/

{

cout<<” hello “;

}

void fun(int a) // function fun with parameter

{

p=a;

cout<<p;

}

};

int main() // main function

{

abc ob; // creating object

ob.fun();// print hello;

ob.fun(6);// print 6

return 0;

}

Explanation:

In this program the function fun() have same name but different signature in the main method we create the object of class abc i.e ob. ob.fun() this statement called the function with no parameter and ob.fun(6) this statement will called the function with integer parameter.

5 0
3 years ago
The answer is family and friends
nadya68 [22]
Family and Friends



you said the answer was that, soooooo
5 0
3 years ago
Read 2 more answers
Other questions:
  • What technique is used to separate the different cell parts?
    15·1 answer
  • What is an administrator?
    15·1 answer
  • Write a Temperature class that will hold a temperature in Fahrenheit and provide methodsto get the temperature in Fahrenheit, Ce
    14·1 answer
  • What is a collection of computer programs that administer the hardware and software of a computer so that they work properly?
    7·1 answer
  • A system is composed of four parts, J, K, L, and M. All four must function for the system to function. The four component reliab
    6·1 answer
  • What changes has Sue made so far? Check all that apply.
    8·2 answers
  • What is the work of the cpu as processer
    6·2 answers
  • Which of the following represent features of free software licensing? Check all of the boxes that apply.
    10·1 answer
  • Why was the Internet first developed? Use details and information to explain your answer.
    6·1 answer
  • True or false? To help improve SEO, your URL should match the title of your blog post, word for word.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!