#include <iostream.h> #include <conio.h> int main(int argc, char *argv[]) { int a[2],b[2],c[2],i,j,k; for(i=0;i<=1;i++) { cout<<"Enter values of first array "; cin>>a[i]; } for(j=0;j<=1;j++) { cout<<"Enter values of second array "; cin>>b[j]; } for(k=0;k<=1;k++) { c[k]=a[i]+b[j]; cout<<c[k]<<endl; } getche(); }
Quote:c[k]=a[i]+b[j];
c[k]=a[k]+b[k];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)