Hello guys, I am very new at the C++ programming world, but I have been reading books, viewing youtube videos, and such.
I am to create 2 arrays, give out their elements; then sum them up and display them in a third array.
I understand the code is bad, it does work but it only sums the first value of each "array" so their not really arrays. This is what I've gotten so far:
#include <iostream>
#include <stdlib.h>
using namespace std;
int main (){
int Num1[0]; //arreglo numero 1
int Num2[0]; //arreglo numero 2
int suma[0]; //Arreglo de Suma
cout << " Escriba un numero para el arreglo 1: ";
cin >> Num1[0]; //arreglo numero 1
cout << " Escriba un numero para el arreglo 2: ";
cin >> Num2[0]; //arreglo numero 2
suma[0] = Num1[0]+Num2[0]; //operacion de suma de los 2 arreglos
cout << " La suma de los dos arreglos dados es: " << suma[0] << endl;
//Resultado de la suma de los dos arreglos
I will accept any critics and recommendations to make sure I comprehend this better.