i made a program for converting Celcius to Fahrenheit and have some troubles with modifying it. I need to all numeration for each line and center numbers in lines. rn my program outputs all to left. Can you please help me with this?
#include <stdio.h>
#include <iostream>
int main(){
// Table header
setlocale(LC_ALL, "");
system("color F0");
printf("\tTable Output\t");
printf("\n----------------------------------\n");
printf("| Celcius \t | Fahrenheit \t |\n");
printf("----------------------------------\n");
// Table body
for (double i = 15; i <= 30; i++)
{
printf("| %.f\t\t | %.1f\t\t |\n", i, 1.8 * i + 32);
}
printf("----------------------------------\n");
printf("\n\tList output\n");
using namespace std;
int main();
{
for (double i = 15; i <= 30; ++i)
{
cout << "Celcius: " << i << " --> Fahrenheit: " << 1.8 * i + 32 << endl;
}
}
return 0;
}