Created
April 26, 2016 17:16
-
-
Save EmilioV97/84db5d02222c7d9a2cf99668419fc65c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
int prod(int a, int b) | |
{ | |
int mul; | |
mul=a*b; | |
return mul; | |
} | |
int main() | |
{ | |
int num, sum=0, musum; | |
cout<<"Cuantos numeros tendra la matriz? "; | |
cin>>num; | |
int M1[num], M2[num]; | |
for(int i=1;i<=num;i++) | |
{ | |
cout<<"Escribe un numero para la matriz uno: "; | |
cin>>M1[i]; | |
} | |
for(int i=1;i<=num;i++) | |
{ | |
cout<<"Escribe un mubero para la matriz dos: "; | |
cin>>M2[i]; | |
} | |
for(int i=0;i<=num;i++) | |
{ | |
musum=prod(M1[i],M2[i]); | |
sum=sum+musum; | |
} | |
cout<<"La respuesta es: "<<sum; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment