Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

    


Feet conversion
 

 

Description

This example prompts the user to enter the feet and then converts this to metres and centimtres .

Code

#include <stdio.h>

int main()
{
float feet,metres,centimetres;
printf("Enter the amount of feet you wish to convert.\n");
scanf("%f",&feet);

while(feet > 0)
{
centimetres = feet * 12 * 2.54;
metres = centimetres / 100;
printf("%6.2f feet is equal to \n",feet);
printf("%6.2f metres\n",metres);
printf("%8.2f centimetres\n",centimetres);
printf("Enter another value to be converted or \n");
printf("enter 0 to exit.\n");
scanf("%f",&feet);
}
return 0;
}

Information

tested using LCC Win 32

 

 

 

 

Download

feetconvert.txt


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
displays IRQ numbers and their statuses(VBScript)
Add lines of text to a file(VB)
decimal to hexadecimal conversion function(Javascript)
Display an Access database(PHP)
download a file from the internet(VB)
delete a directory(C Sharp)
Log on as different user(VB)
Create a file(C Sharp)

    




Copyright © 2003 by programmershelp.co.uk