?
Solved

Print a Title message in this conversion list

Posted on 2003-02-23
6
Medium Priority
?
185 Views
Last Modified: 2010-04-15
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
Comment
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
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 9

Expert Comment

by:tinchos
ID: 8005741
what is it you are trying to print

dind fully understand
0
 
LVL 9

Expert Comment

by:tinchos
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

by:gmahler5th
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:gmahler5th
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

by:
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

by:gmahler5th
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

Technology Partners: 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!

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

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question