Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <iostream>
- using namespace std;
- int main()
- {
- const int n = 5;
- int a[n],b[n];
- for (int i = 0; n > i; i++)
- {
- a[i] = rand() % 20+ (-10);
- cout << a[i] <<endl;
- }
- cout << endl;
- for (int i = 0; n > i; i++)
- {
- if (a[i] < 0)
- {
- b[i] = a[i] * (-1);
- }
- else
- {
- b[i] = a[i];
- }
- cout << b[i] << endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement