Generation

generate functionMon, 31 Jul 2023

Crear 2 arreglos que permitan agregar 5 números enteros positivos, luego crear un tercer arreglo de 5 números y que cuyo valor en cada posición sea la suma de los 2 valores en dicha posición.

#include <iostream> using namespace std; int main(){ int listA[5]; int listB[5]; int listC[5]; for(int i=0; i<5; i++){ cout << "enter value for list A " << i+1 << " "; cin >> listA[i]; cout << "enter value for list B " << i+1 << " "; cin >> listB[i]; listC[i] = listA[i] + listB[i]; } cout << "list C: " << endl; for(int i=0; i<5; i++){ cout << listC[i] << endl; } }

Want to kickstart your project?Use the new AI Studio to create your code