#include<iostream>
using namespace std;
int main()
{
float n, i, s = 0;
cout << "Enter A float Number : ";
cin >> n;
cout << endl;
for(i=1.5;i<=n;i++)
{
cout << i;
if(i != n)
{
cout << " + ";
}
s = s + i;
}
cout << " = " << s << endl;
return 0;
}
using namespace std;
int main()
{
float n, i, s = 0;
cout << "Enter A float Number : ";
cin >> n;
cout << endl;
for(i=1.5;i<=n;i++)
{
cout << i;
if(i != n)
{
cout << " + ";
}
s = s + i;
}
cout << " = " << s << endl;
return 0;
}
Comments
Post a Comment