In the C programming language, you can't determine the array size from the parameter, so you have to pass it in as an extra parameter. The solution could be:
#include <stdio.h>
void swaparrayends(int arr[], int nrElements)
{
int temp = arr[0];
arr[0] = arr[nrElements - 1];
arr[nrElements - 1] = temp;
}
void main()
{
int i;
int myArray[] = { 1,2,3,4,5 };
int nrElements = sizeof(myArray) / sizeof(myArray[0]);
swaparrayends(myArray, nrElements);
for (i = 0; i < nrElements; i++)
{
printf("%d ", myArray[i]);
}
getchar();
}
In higher languages like C# it becomes much simpler:
static void Main(string[] args)
{
int[] myArray = {1, 2, 3, 4, 5};
swaparrayends(myArray);
foreach (var el in myArray)
{
Console.Write(el + " ");
}
Console.ReadLine();
}
static void swaparrayends(int[] arr)
{
int temp = arr[0];
arr[0] = arr.Last();
arr[arr.Length - 1] = temp;
}
Answer:
By presuming Kumar was working on his term paper using Microsoft Word, he can be advised to restore the unsaved document using the Recover Unsaved Documents feature in Word.
Explanation:
Firstly, Kumar can click File tab in Word and click Manage Document. Kumar shall find the option Recover Unsaved Documents from a drop down list and he can click it as his option. At this stage, Kumar shall see the missing files in the dialog box. The recent loss file shall appear in the dialog box. Just open the desired document and save it.
<span>E-waste is a popular name for elecronics at the end of their "useful life".. computers, tv, steros, copiers, and fax mations are some common products. many of them can be reused, refurbished, or recycled.
</span>
Two computers can safely have the same IP address in certain cases. In most cases, if those two computers are on the same local network, it breaks connectivity for one or both of them. Internet protocols work by sending small, individually addressed messages. Each message can be routed differently.
I hope this helps you.
A distributed computer system consists of multiple software components that are on multiple computers, but run as a single system. The computers that are in a distributed system can be physically close together and connected by a local network, or they can be geographically distant and connected by a wide area network.