Calculate Total and Percentage


#include<iostream.h>
#include<conio.h>

void main()
{
    int m1, m2, m3, m4, total;
    float per;
    clrscr();

    cout<<"Enter four numbers:";
    cin>>m1>>m2>>m3>>m4;

    total = m1 + m2 + m3 + m4;

    cout<<"Total: "<<total;

    per = (float) total / 4;

    cout<<" Percentage: "<<per;
}
Previous Post Next Post