Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 589877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:28:11+00:00 2026-05-13T15:28:11+00:00

Is there a way to write a C program to convert say Dollar to

  • 0

Is there a way to write a C program to convert say Dollar to Indian Rupee (or visa-versa). The conversion parameter should not be hard coded but dynamic. More preciously it should get the latest value of Rupee vs Dollar automatically(from Internet) ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:28:11+00:00Added an answer on May 13, 2026 at 3:28 pm

    Step 1 would be to get the latest conversion rate. You can use a web-service for that. There are many available. You can try this.

    Request:

    GET /CurrencyConvertor.asmx/ConversionRate?FromCurrency=INR&ToCurrency=USD HTTP/1.1
    Host: www.webservicex.net
    

    Response:

    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    
    <?xml version="1.0" encoding="utf-8"?>
    <double xmlns="http://www.webserviceX.NET/">SOME_RATE_IN_DOUBLE</double>
    

    For sending the request you can make use of cURL.

    Once you have the response, just parse it to get the rate. Once you’ve the rate you can easily write the program to convert.

    EDIT:

    If using cURL is something you are not comfortable with you can make use of good old system and wget. For this you need to construct the URL first like:

    http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=INR&ToCurrency=USD

    then from the C program you can do:

    char cmd[200];
    char URL[] = "www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=INR&ToCurrency=USD";
    sprintf(cmd,"wget -O result.html '%s'",URL); // ensure the URL is in quotes.
    system(cmd);
    

    After this the conversion rate is in the file result.html as XML. Just open it and parse it.

    If you are using windows, you need to install wget for windows if you don’t have it. You can get it here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.