Skip to main content

base 10 to octal conversion of multiple numbers in c++ using for loop

#include<iomanip>
#include<iostream>
using namespace std;
int main()
{
int x;
for(int i=0;i<5;i++)
{
 cout<<"Please enter input:";
 cin>>x;
cout<<"Your input in base 10 is "<<x<<" and in base 8 is "<<oct<<x<<endl;
}
return 0;
}
***************************
output:

Comments