//This programme is tested on visual studio 2012//
#include <iostream>
using namespace std;
void main()
{
float a,sum=0;
cout<<"------------------------------------------------------------------------------\n";
cout<<"This programme will input numbers and print their sum on entering-999\n";
cout<<"------------------------------------------------------------------------------\n";
cout<<"Enter no = ";
cin>>a;
for (int i=0;i<2;i++)
{
cout<<"Enter no = ";
cin>>a;
if(a==-999)
{
cout<<"\nThe sum of the numbers entered except -999 = "<<sum;
break;
}
sum=sum+a;
i=0;
}
cout<<"\n\n------------------------------------------------------------------------------\n";
cout<<"Thank You for using.\n\nVisit http://bilalzahid22.blogspot.com/ for more\n";
cout<<"\n------------------------------------------------------------------------------\n";
}


0 comments:
Post a Comment