### Help Aligning Function Outputs

when i run my code i want each function to be displayed side by side from left to right and i cant figure out how to do it. also cant figure out how to make the numbers right justified. any help is appreciated. Thanks

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103`` ``````#include "stdafx.h" #include #include #include #include using namespace std; void ClearTheScreen(); void Heading(); void NormalTermination(); void K(); void SquareRoot(); void Cube(); void CubeRoot(); int main() { Heading(); K(); SquareRoot(); Cube(); CubeRoot(); return 0; } void ClearTheScreen() { system("cls"); } void Heading() { ClearTheScreen(); cout << "\t\t xxxxxxx xxxxxxx xxxxxxxxx xxxxxxxx"; cout << "\n\t\t\t\t xxxxxxx xxxxxxx"; cout << "\n\n\t\t\t\t CS xxx"; cout << "\n\t\t\t\t Beginning C++"; cout << "\n\n\t\t\t\t xxxxxxx xxxxx\n\n "; } void NormalTermination() { cout << "\n\t\t\t"; } void K() { int k; cout << "\t\tk"; k = 0; while ( k < 15 ) { cout << "\t\t "; cout <<"\n\t\t"<< k+1<< right << setw(12)<< endl; k++; } } void SquareRoot() { int n; cout << "\tsqrt"; n = 0; while ( n < 15 ) { cout << "\t\t\t "; cout << "\n\t\t "<< sqrt (n+1.0); n++; } } void Cube() { int k; cout << "\t\t\t\t cube\n\n"; k = 0; while ( k < 15 ) { cout << "\t\t\t\t "; cout << "\n"<< pow(k+1.0,3); k++; } } void CubeRoot() { int k; cout << "\t\t\t\t\t cube root\n\n"; k = 0; while ( k < 15 ) { cout << "\t\t\t\t\t "; cout << "\n"<< pow(k+1.0,1.0/3); k++; } }``````
Last edited on
Topic archived. No new replies allowed.