#include <iostream>
using namespace std;
int main(){
// we declare an one-dimensional array that accepts n length
int n=5;
int arr[n];
// we should enter the elements of array from keyboard
cout << "Enter 5 integer numbers: " << endl;
for (int i = 0; i < n; i++){
cin >> arr[i];}
cout << "The entered array is : " <<endl;
for (int i = 0; i < n; i++) {
cout << arr[i] << " \n";
if (arr[i] % 2 == 0)
cout<<"The sqaure of " <<arr[i]<<" is : "<<arr[i]*arr[i]<<"\n";
}
return 0;
}
Comments
Leave a comment