Thursday, 18 July 2013



#include "stdafx.h"
#include "conio.h"
#include "iostream"
#include "stdio.h"

using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
       int a,b,c,d,e;
       int n,i;
       int sum=0;
       float ave;
       cout<<"enter any 5 numbers"<<endl;
       cin>>a>>b>>c>>d>>e;
       i=a;
       while(i<=e)
       {
              sum=sum+i;
              i++;
       }
              ave=sum/5;
              cout<<"ave="<<ave<<endl;
      
       getch();

}
Reactions:

0 comments :

Post a Comment