Techno Life, Micromax New Version Official Firmware, Winmax official firmware, Nokia Flash File, WhatsApp Messenger, Lenovo, huawei, xiaomi, samsung galaxy

Cari Blog Ini

Diberdayakan oleh Blogger.
Senin, 03 Februari 2014

C# Program for Array solving problems

C# Program for Array solving problems - these days more and more blogs that talk about technology, including blogs Techno Life but we are very experienced in this case because we have been there from a few years ago always present information about techno for you, well now we are about C# Program for Array solving problems hopefully the information we will convey can answer your question to google, please see:

Articles : C# Program for Array solving problems
full Link : C# Program for Array solving problems
Article Csharp, Article programs,

You can also see our article on:


C# Program for Array solving problems

C# Program for Array solving problems

Program Statement:
Write a function which takes four arrays of same size as arguments; array1, array2, array3, array4. The function will multiply the corresponding values of array1 and array2 and will save the result at same index of array3. i.e. array3[0] = array1[0] * array2[0] and so on. Then create another function and pass all four arrays to that function as argument where you have to compare array1, array2 and array3 and save the max value in array4 i.e. if array1[0] = 10, array2[0] = 5, array3[0]= 11 then you have to save max value i.e. array4[0] = 11. In main function, show all values of array4.

Solution:
 class _arr
{
public void mul(int n, int[] array1, int[] array2, int[] array3)
{
for (int i = 0; i < n; i++)
{
array3[i] = array1[i] * array2[i];

}
Console.Write("\nArray3 = Array1 * Array2 : ");
for (int i = 0; i < n; i++)
{
Console.Write("{0} ", array3[i]);
}
Console.WriteLine();
}
public void com(int n, int[] array1, int[] array2, int[] array3, int[] array4)
{
for (int i = 0; i < n; i++)
{
int max = 0;
if (array1[i] >= array2[i] && array1[i] >= array3[i])
max = array1[i];
else if (array2[i] > array3[i])
max = array2[i];
else
max = array3[i];
array4[i] = max;
}
Console.Write("\nMaximum numbers in array are : ");
for (int z = 0; z < n; z++)
{
Console.Write("{0} ", array4[z]);
}
Console.WriteLine("\n");
}
}




information C# Program for Array solving problems has been discussed

hopefully the meaning of C# Program for Array solving problems that we write can be useful for you in adding insight about gadgets.

you just finished reading the article titled C# Program for Array solving problems if you want to bookmark or share your links use the link https://lifeandeating.blogspot.com/2014/02/c-program-for-array-solving-problems.html do not forget to go back to this blog if you want to get the latest information about gadgets.

Tag : , ,
Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : C# Program for Array solving problems

0 komentar:

Posting Komentar