Answer:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,array1[5],array2[5],SumArray[5];
clrscr();
printf("\nReading the first array\n");
for (i=0;i<5;i++)
{
printf("Enter the values");
scanf("%d",&array1[i]);
}
printf("\nReading the second array\n");
for (i=0;i<5;i++)
{
printf("Enter the values");
scanf("%d",&array2[i]);
}
printf("\nThe result of addition of two arrays is :\n");
for(i=0;i<5;i++)
{
SumArray[i]=array1[i]+array2[i];
printf("\n sum of %d & %d is
%d",array1[i],array2[i],SumArray[i]);
}
getch();
}
Write a C program that inputs 5 elements into each of 2 integer arrays. Add corresponding...
i need help writing these programs in c++ format
1. Enter two integer arrays: array1-129, 0, -56, 4, -7 and array2-19, 12, -36, -2, 12 3. Write the code to form and display another array array3 in which each element is the sum of numbers in the position in both arrays. Use pointers and functions: get array0. process arrays0 and show array0 (50 points) 2. Enter a positive 5-digit integer via the keyboard. Display each digit and fol- lowed by...
C++ File I/O Create a program that will work for all "infile.txt" of similar structure: The first line will contain two integers. The first integer is the number of elements in array1, and the second integer the number of elements in array2. The second line will contain all the values of array1, and the third line will contain all values of array2. All numbers are separated by a space and all lines separated by a newline character. "infile.txt" has three...
Exercise 13.5 Write a Bash script that contains two numeric arrays, array1 and array2, initialized to the values in the sets {1, 2, 3, 4, 5} and {1, 4, 9, 16, 25}, respectively. The script should produce and display an array whose elements are the sum of the corresponding elements in the two arrays. Thus, the first element of the resultant array is 1 + 1 = 2, the second is 2 + 4 = 6, and so on.
Write a program to merge two sorted arrays into a third array. Ask the user to enter the size of the two arrays. The length of array1 could be greater than, equal to or less than the length of array2. Fill both with random numbers 0-99. Sort both arrays as explained below. Write a method merge that takes the two arrays as arguments. The method returns a merged array with size equal to the size of both arrays combined. Note:...
Write a C++ console application that adds the corresponding elements of two integer arrays of size five. Prompt the user for the ten values and store the first five in the first array and the second five in the second array. Then create and call function matrixAdd that adds the two arrays and prints the five sums. Here is the function prototype: void matrixAdd(int firstArr[], int secondArr[]); [your program code here]*
Write a C++ program that simulates playing the Powerball game. The program will generate random numbers to simulate the lottery terminal generated numbers for white balls and red Powerball. The user will have the option to self-pick the numbers for the balls or let the computer randomly generate them. Set the Grand Prize to $1,000,000,000.00 in the program. Project Specifications Input for this project: Game mode choice – self pick or auto pick Five numbers between 1 and 69 for...
For c++ Write a complete C++ program and declare 2 arrays type double size 5. The name of the first array is Salary and the name of the second array is Tax. Use a for loop loop and enter 5 salaries type double into array Salary. Then multiply each element of array Salary by .10 (10 percent), and save the result into array Tax. Print/display the content of both arrays. Hint: the content of array Tax is 10% percent of...
** C++ LANGUAGE ** Write a function that will implement each Fibonacci number with the help of an integer array of size 100 (elements of this array will be digits of the Fibonacci number). When the function is called to find , it will calculate all Fibonacci numbers from to using the basic formula . To add two Fibonacci numbers, the function will add elements of two arrays corresponding to and and store their sums in the array corresponding to...
using matlab
In Class Exercises 8-Arrays For the following exercises, assume an array is already populated, your job is to write a program that traverses the array. DO NOT HARD CODE the last index. In other words, you code for 1-4&6 should be able to handle the following 2 arrays: amp2 10 array1 [52, 63, 99, 71, 3.1] array2 - [99:-3: 45); For 5: wordArray1 wordArray2 ('number, 'arrays', 'indices', 'hello', finish' [number, 'different, 'finish? 1. Determine the sum of all...
Suppose we have two integer arrays with the same type, write an AL program to check whether or not there are two integers, one from each array, with sum equal to zero. If there are such integers exist, print out all such combinations to the console window, otherise, print out "No integers in these two arrays, one from each array, with sum equal to zero." to the console window. December 3. 2018 For example, suppose we have the following two...