CBSE 2010
#include <iostream.h>
#include <conio.h>
void REASSIGN(int a[], int size)
{
for(int i = 0 ; i < size ; i++)
{
if(a[i]%5 == 0)
a[i] = a[i] / 5;
else
a[i] = a[i] * 2;
}
void main()
{
int arr[25];
int n, i;
cout << "\n Enter the size of an array (<25):":
cin >> n;
for( i = 0 ; i < n ; i++)
{cout<< "\n Enter an element :";
cin >> arr[i];
}
/* Display original array */
cout<< "\n The Original array :";
for(i = 0 ; i < n ; i++)
cout<< arr[i] << " ";
REASSIGN(arr, n);
cout<< "\n The changed array :";
/* Display the changed array */
for(i = 0 ; i < n ; i++)
cout<< arr[i] << " ";
getch();
}
its very useful site and very helpful for c++ coding
ReplyDeletethanks