roofline.devPublic Beta

Vector Addition

0VERY EASYPracticeReport issue

Given vectors a\underline{a} and b\underline{b} of length nn, produce vector c\underline{c} of length nn such that ci=ai+bic_i = a_i + b_i.

Input

  • a - first input vector of length n.
  • b - second input vector of length n.
  • n - the number of elements in each vector.

Output

  • c - output vector of length n such that ci=ai+bic_i = a_i + b_i.
Open on a desktop browser to write and submit code.

Public submissions

Practice problem · every submission below is public, click to view code