Sunday 15 June 2014

C++ program to calculate PI, resistance and power


Here is a C++ program to calculate PI, resistance and power


 SOURCE CODE OUTPUT
#include <iostream>
using namespace std;
int main()
{
    float current,voltage,resistance,power;
    cout<<"Enter the value of current and voltage ";
    cin>>current>>voltage;
    resistance=voltage/current;
    power=current*resistance*resistance;
    cout<<"Resistance = "<<resistance<<endl;
    cout<<"Power = "<<power;
    return 0;
}

Any questions regarding to program please write in comments.

No comments:

Post a Comment