[ create a new paste ] login | about

Link: http://codepad.org/1Y9GKyk6    [ raw code | output | fork ]

C++, pasted on Jul 9:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
int main() {
  int a[] = {1, 2, 3, 4, 5, 6};
  int b[] = {6, 5, 4, 3, 2, 1};
  int c[sizeof(a)/sizeof(int)];
  for (unsigned int i = 0; i < sizeof(a)/sizeof(int); i++)
    c[i] = a[i] - b[i];
  for (unsigned int i = 0; i < sizeof(a)/sizeof(int); i++)
    std::cout << c[i] << ", ";
  std::cout << std::endl;
  return 0;
}
/* end */


Output:
1
-5, -3, -1, 1, 3, 5, 


Create a new paste based on this one


Comments: