Sunday 15 June 2014

C++ program to calculate percentage



Here is a C++ program to calculate percentage


 SOURCE CODE OUTPUT
#include <iostream>
using namespace std;
int main()
{
    float first,secd,percentge;
    cout<<"Enter first number ";
    cin>>first;
    cout<<"Enter second number ";
    cin>>secd;
    percentge=first*100/secd;
    cout<<first<<" out of "<<secd<<" = "<<percentge<<"%";
    return 0;
}

Any questions regarding to program please write in comments.

No comments:

Post a Comment