[ create a new paste ] login | about

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

C++, pasted on May 30:
#include "iostream"
#include "ctime"
 
using namespace std;
 
const int n = 16;
const int m = n / 2;
 
int main()
{  
    srand(time(0));
    int A[n] = {0};
    int B[m] = {0};
 
    cout << "Array A:\n\n";
    for(int i = 0; i < n; i++)
    {
        cout << (A[i] = rand() % 10) << " ";
    }
 
    cout << "\n\nArray B:\n\n";
    for(int i = 0, j = n - 1; i < n / 2; i++, j--)
    {
        cout << (B[i] = A[i] + A[j]) << " ";
    }
 
    system("pause >> null");
    return 0;
}


Output:
1
Disallowed system call: SYS_fork


Create a new paste based on this one


Comments: