Question

1 0
Add a comment Improve this question Transcribed image text
Answer #1

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();
}

Add a comment
Know the answer?
Add Answer to:
Write a C program that inputs 5 elements into each of 2 integer arrays. Add corresponding...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • i need help writing these programs in c++ format 1. Enter two integer arrays: array1-129, 0,...

    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...

  • Write a program to merge two sorted arrays into a third array. Ask the user to...

    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++ program that simulates playing the Powerball game. The program will generate random numbers...

    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...

    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...

  • 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 in...

    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...

  • ** C++ LANGUAGE ** Write a function that will implement each Fibonacci number with the help...

    ** 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...

  • Suppose we have two integer arrays with the same type, write an AL program to check...

    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...

  • Q1. Write a program in Java         a. Create 2 separate arrays, of user defined values,...

    Q1. Write a program in Java         a. Create 2 separate arrays, of user defined values, of same size         b. Add these 2 arrays. ........................................................................................................................... Q2. Write a program in java (using loop) input any10 numbers from user and store in an array. Check whether each of array element is positive, negative, zero, odd or even number. ............................................................................................................................ Q3. Write a program in Java to display first 10 natural numbers. Find the sum of only odd numbers. .............................................................................................................................. Q4....

  • Language C Code Write a program that takes two integer arrays (A and B) and sums...

    Language C Code Write a program that takes two integer arrays (A and B) and sums them together (element wise). A third array to accept the result should be passed in as the output argument. Assume the arrays are all the same size. The argument N is the size of the arrays. Your code should provide a function with the following signature: void array Addition (int A[], int B[], int N, int output[]) { } Your code must also provide...

  • Write a C program that initializes an integer array, and two scalar values a and b....

    Write a C program that initializes an integer array, and two scalar values a and b. Your program should multiply each elements of the array with a and add b to the product to form a new array output. Display the output array.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT