C++ Program to calculate sum and average of three numbers

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

void main()
{
clrscr() //to clear the screen
float a,b,c,sum,av;
cout<<“Enter three numbers:”;
cin>>a>>b>>c;

sum=a+b+c;
av=sum/3;
cout<<“nSUM=”<<sum;
cout<<“nAverage=”<<av;

getch(); //to stop the screen
}

10 thoughts on “C++ Program to calculate sum and average of three numbers

  1. Kevin

    if there is void main then what is the need of getch If we type void main() we need not type getch

    Reply
  2. sachin khutan

    write the program ave of 5 numbers in simple cpp using cin cout

    Reply
  3. THOMAS ANYANJE

    please write a program class tollbooth. with three members. 1. payingcar() increments car total and adds 50 shillings to the total cash collected,2nopaycar() increments the car total and adds nothing to the total cash,3.display() displays the two totals.the program should allow the user output total cars and cash and exit. thanks i like your work

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *