hi all;
I need help with this simple program;
I was asked to declare an array of int type called value with 5 elements [ 2,4,6,8,10] . I want to use while structre to change the value of each element in the array to be the square of its original value. I made this code, but its not working,
# include < iostream >
int main()
{
int value []= { 2,4,6,8,10 };
int i=0 ,i++;
while ( i<5 )
{
std::cout<< value [i] * value [i]<<std::endl;
}
return 0;
}
thanks in advance
I need help with this simple program;
I was asked to declare an array of int type called value with 5 elements [ 2,4,6,8,10] . I want to use while structre to change the value of each element in the array to be the square of its original value. I made this code, but its not working,
# include < iostream >
int main()
{
int value []= { 2,4,6,8,10 };
int i=0 ,i++;
while ( i<5 )
{
std::cout<< value [i] * value [i]<<std::endl;
}
return 0;
}
thanks in advance
Comment