Hello, i would like to change this program that someone on this forum helped me make, the program works fine, but i dont know how to make it only show the 4th root of even numbers from 2-20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream>
#include <iomanip>
usingnamespace std;
int main()
{
int numb;
for(numb=0; numb<=30; numb++)
{
if(numb%2!=0){
cout << setw(4) << numb;
int cube = numb*numb*numb;
cout << setw(6) << cube << endl;
}//end if
}
system("PAUSE");
return 0;
}
- "of numbers 2-20" - you will have to change your for-loop on line 7.
- you will need to introduce a way that calculates the fourth power of a number so you can check it against "the even number between 2 and 20".
Please have a go at modifying the code and come back to us with any specific issues you encounter.