+ 1
Is it possible to make a table using the for loop?
I wondering if there was a way to display a table using the for loop. I want to make a temperature conversion table using Fahrenheit and Centigrade but I only learned how to make the Fahrenheit side work okay. How do I get the Centigrade side to display next to the Fahrenheit side? Edit: I need an example. Iâm back to square one. I want my code to look like this below: âŹïž Fahrenheit Centigrade 32 0
5 Answers
+ 6
Yes. You want to print both together on each line somthing like
Print "fahrenheit"+" "+"Centigrade"
Print. "32"+" "+"0"
If you get stuck ill make an example for you đ
+ 1
Have a look at printf
http://www.cplusplus.com/reference/cstdio/printf/
0
Thank you! :) Iâll try it now.
0
Also one more question, is the code written out as cout << âfahrenhietâ+â +âCentigradeâ << endl; ?
0
Is printf a variable for something? I havenât learned anything about that yet.