C++ problem (in text form):
Write a program that accepts two arrays of some dimension and computes the limited sum of the arrays
problem : C++ problem
Write a program that accepts two arrays of some dimension and computes the limited sum of the arrays.
Solution :
#include <iostream>
using namespace std;
int main(){
int n1,n2;
cout << "Enter a first array size :
";
cin >> n1;
//taking the input of size of
the first array
int i,a[n1];
cout << "Enter the numbers to first array :"
<< endl;
for(i=0;i<n1;i++){
cout <<
"Enter a value of a[" << i << "] = ";
cin >>
a[i]; //taking
the input values of the first array
}
cout << "Enter a second array size : ";
cin >> n2;
//taking the input of size of the second
array
int b[n2];
cout << "Enter the numbers to second array :"
<< endl;
for(i=0;i<n2;i++){
cout <<
"Enter a value of b[" << i << "] = ";
cin >>
b[i]; //taking
the input values of the second array
}
cout << "Sum of the arrays : " <<
endl;
/*if size of the first array greater than second
array
then we find the limited sum according to size of the
second array
otherwise size of the second array greater than first
array
then we find the limited sum according to size of the
first array */
if(n1 > n2){
for(i=0;i<n2;i++){
cout << a[i] + b[i] << endl;
}
}else{
for(i=0;i<n1;i++){
cout << a[i] + b[i] << endl;
}
}
}


output :

C++ problem (in text form): Write a program that accepts two arrays of some dimension and...
Write a C function bool arrayEqual that compares two 2D arrays. It accepts the following arguments int a[ROW][COL], int b[ROW][COL], m, n (m and n are the size of the rows and columns correspondingly). It returns true if all the corresponding elements are equal in a and b, otherwise false. Write the main function. Initialize two arrays (e.g. 3*4 dimension).
and then print their average. Write a C program that accepts a string of text from the user and prints back the string without any of the vowels. For example, if the user entered "Hello, world", the program should print "Hll, wrld" Write a C program that accepts an integer in decimal from the user and prints the number of 1' bits in the integers binary representation. For example, if the user entered 14, the program should print 3 because...
Write a C program that accepts a phone number of the form +1(xxx)-xxx-xxxx where x is a digit, and displays the sum of all digits in the phone number.
PYTHON: Using Lists and Arrays! 5. In a program, write a function that accepts two arguments: a list, and a number n. The program should generate 20 random numbers, in the range of 1 through 100, and assign each number to the list. The program should also ask the user to pick a number from 1 through a 100 and assign that number to n. The function should display all of the number in the list that are greater than...
c++ write a boolean function that accepts two integer arrays of size 10 as input parameters, the function should return true if there are any similar values between the two arrays and shall return false if not, if there are similar values, print out on screen
Programming in C: Write a program that accepts an integer and two floating-point values and prints the sum of these values. Example: Input:12,13.14,6.7; Output:31.84. Use formatted I/O
Write a program with a function named isEqualArr that accepts a pair of arrays of integers as parameters and returns true if the arrays contain the same elements in the same order. If the arrays are not the same length, your function should return false. For example, if the following arrays are declared: int[] arr1 = {10, 20, 30, 40, 50, 60}; int[] arr2 = {10, 20, 30, 40, 50, 60}; int[] arr3 = {20, 3, 50, 10, 68}; The...
JAVA PROGRAM Write a program that contains the following two methods Write a method that accepts a user string as a parameter and converts any words that are in all uppercase to all lowercase. Note: the first letter at the start of a sentence should remain in upper case if that is what the user enters. See example below. Enter Initial Text: (prompts user for text) Currently: HEY! What do you think about this CRAZY STUFF!! WHAT a day. Revised...
Write a SIMPLE C++ Program that performs the Multiplication of 2 Arrays (two dimensional arrays). Use Comments to give a Simple description.
In C++ cout<<"" << NO std:cout Write a function that accepts two integer arrays of the same size. The first array will have numbers and the second array will be filled out inside the function. The function should find all numbers in the array that are greater than or equal to the average and fill out the second array with these numbers. You need to design the function.Comments as well please because i am super confused. Thank you!