Main Menu

HOME

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

Make money selling software. Check this out here

Hosted clickbank mall. Check this out here




   Misc

   Amazon

   Links

    


power calculator
 

 

 

Description

This example will calculate the power based on whatever the user enters as the voltage and teh current.

Code

#include <stdio.h>

int main()
{
float power,voltage,current;
voltage = current = 0;

printf("Power calculator.\n");
printf("This will calculate the power in watts , ");
printf("when you input the voltage and current.");
/*get the voltage*/
printf("Enter the voltage in volts.\n");
scanf("%f",&voltage);
/*get the current*/
printf("Enter the current in amps.\n");
scanf("%f",&current);
/*calculate the power*/
power = voltage * current;
printf("The power in watts is %.2f watts\n",power);

return 0;
}

Information

tested using Visual C++ and Windows XP

 

 

 

 

Download

power1.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
Enum example(C++)
copy a file from one location to another(VBScript)
list running processes(Powershell)
Browser info(ASP.net)
Yahoo news(PHP)
Pop up example(Javascript)
Image resizer(PHP)
blinking label(VB)

    




Copyright © 2003 by programmershelp.co.uk