User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 427,795 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,718 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums

help with conversion calculator

Join Date: Nov 2004
Posts: 123
Reputation: boujibabe is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
boujibabe boujibabe is offline Offline
Junior Poster

help with conversion calculator

  #1  
Oct 7th, 2006
this code to convert pounds to barbados dollars given a constant rate the price cannot go over $100 when i first run it and input a number under 100 it tells me that it is invalid and sometimes i get nothing at all. Can neone tell me why?

/* This Program converts Pounds Sterling to Barbados Dollars*/
# include <stdio.h>

int main ()

{
	float Pds, Bds; /* Declare Variables*/
	const float Rate =3.75;

	printf("Enter the Price in Pounds Sterling\n"); /*Prompt User*/
	scanf_s("%f", &Pds);

   while(Pds >100);/* finds illegal value*/
   {
    printf("Error your price cannot be greater than $100\n");
	printf("Please Enter another\n");
	scanf_s("%f",&Pds);
   }

     Bds=Pds*Rate;

     printf("Price in Barbados Dollars=%.2f",Bds);

	
	return 0;

	}
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 2:00 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC