• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

Stacking?

printf("1.00 Euro = 1.28 us dollar");
printf("1.00 UK pound = 1.87 us dollar");
printf("1.00 japanese yen = 1.01 us dollar");
printf("1.00 canadian dollar = 0.82 us dollar");
printf("1.00 Australian dollar = 0.77 us dollar");

How do I get the above to be displayed on different lines instead of one right after the other wraped from the same line?
0
alwright1975
Asked:
alwright1975
  • 2
1 Solution
 
josgoodCommented:
Add \n at the end of each, as in
printf("1.00 Euro = 1.28 us dollar\n");
printf("1.00 UK pound = 1.87 us dollar\n");
printf("1.00 japanese yen = 1.01 us dollar\n");
printf("1.00 canadian dollar = 0.82 us dollar\n");
printf("1.00 Australian dollar = 0.77 us dollar\n");
0
 
UrosVidojevicCommented:
printf("1.00 Euro = 1.28 us dollar\n");
printf("1.00 UK pound = 1.87 us dollar\n");
printf("1.00 japanese yen = 1.01 us dollar\n");
printf("1.00 canadian dollar = 0.82 us dollar\n");
printf("1.00 Australian dollar = 0.77 us dollar\n");
0
 
UrosVidojevicCommented:
josgood was faster :-)
0
 
Infinity08Commented:
And just fyi : \n is the newline character. It's one character (escaped) and here's a few more that might be interesting (the most common) :

        \t : horizontal tab
        \n : new line feed
        \\ : backslash
        \' : single quote
        \" : double quote
        \0 : null terminator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now