Solved

# Print a Title message in this conversion list

Posted on 2003-02-23
Medium Priority
185 Views
How can I include a printed title at the top of this conversion list such as "Currency Conversion," ??  I keep getting compile errors for wrong number of args.

/* Prints a message on the screen */
#include <studio.h>
main()

{
float Euro, Peso, Yen, Pound, Shekel;
/*Declare how much \$1 USD is when converted to these currencies */
/*www.xe.com -- Live mid-market rates as of 2003.02.24 01:31:21 GMT */
Euro = 0.932543;
Peso = 10.9554;
Yen = 118.411;
Pound = 0.634517;
Shekel = 4.87100;

/*Print the conversion for how much 1 of each currency is in USD*/
printf("1 Euro = %f USD  \n", (float)1/Euro);
printf("1 Peso = %f USD  \n", (float)1/Peso);
printf("1 Yen = %f USD  \n", (float)1/Yen);
printf("1 Pound = %f USD  \n", (float)1/Pound);
printf("1 Shekel = %f USD  \n", (float)1/Shekel);
return 0;
}
0
Question by:gmahler5th
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3
• 3

LVL 9

Expert Comment

ID: 8005741
what is it you are trying to print

dind fully understand
0

LVL 9

Expert Comment

ID: 8005746
maybe

/* Prints a message on the screen */
#include <studio.h>
main()

{
float Euro, Peso, Yen, Pound, Shekel;
/*Declare how much \$1 USD is when converted to these currencies */
/*www.xe.com -- Live mid-market rates as of 2003.02.24 01:31:21 GMT */
Euro = 0.932543;
Peso = 10.9554;
Yen = 118.411;
Pound = 0.634517;
Shekel = 4.87100;

printf("Currency Conversion\n");

/*Print the conversion for how much 1 of each currency is in USD*/
printf("1 Euro = %f USD  \n", (float)1/Euro);
printf("1 Peso = %f USD  \n", (float)1/Peso);
printf("1 Yen = %f USD  \n", (float)1/Yen);
printf("1 Pound = %f USD  \n", (float)1/Pound);
printf("1 Shekel = %f USD  \n", (float)1/Shekel);
return 0;
}
0

Author Comment

ID: 8005784
I keep getting the following error when I used the print command that you added.

C:\Program Files\Miracle C\examples\test.c: line 18: wrong # args in function call
'printf("1 Euro = %f USD  \n", (float)1/Euro)'
aborting compile

I am trying to print the list that I posted, but the the title "Currency Conversion" as the title that appears first, before the list is printed.

0

Author Comment

ID: 8005799
I keep getting the following error when I used the print command that you added.

C:\Program Files\Miracle C\examples\test.c: line 18: wrong # args in function call
'printf("1 Euro = %f USD  \n", (float)1/Euro)'
aborting compile

I am trying to print the list that I posted, but the the title "Currency Conversion" as the title that appears first, before the list is printed.

0

LVL 9

Accepted Solution

tinchos earned 80 total points
ID: 8005801
/* Prints a message on the screen */
#include <stdio.h>
main()

{
float Euro, Peso, Yen, Pound, Shekel;
/*Declare how much \$1 USD is when converted to these currencies */
/*www.xe.com -- Live mid-market rates as of 2003.02.24 01:31:21 GMT */
Euro = 0.932543;
Peso = 10.9554;
Yen = 118.411;
Pound = 0.634517;
Shekel = 4.87100;

printf("Currency Conversion\n");

/*Print the conversion for how much 1 of each currency is in USD*/
printf("1 Euro = %f USD  \n", (float)1/Euro);
printf("1 Peso = %f USD  \n", (float)1/Peso);
printf("1 Yen = %f USD  \n", (float)1/Yen);
printf("1 Pound = %f USD  \n", (float)1/Pound);
printf("1 Shekel = %f USD  \n", (float)1/Shekel);
return 0;
}

this code is compiling
0

Author Comment

ID: 8005886
Sweeet!  Thanks!

I dont' know what I was doing wrong for this not to compile at first, but it seems to be working now.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
###### Suggested Courses
Course of the Month14 days, 20 hours left to enroll