#include<iostream>
#include<cmath>
#include<stdlib.h>
#define esp 0.000001
using namespace std;
int main()
{
int n,i;
float sum=0;
for(i=1;i<+5;i++)
{
cout<<"enter the number "<< i<<endl;
cin>>n;
if(n==0)
{
cout<<"zero is not define";
continue;
}
sum=sum+1/n;
}
cout<<"the sum is"<<sum<<endl;
}
#include<cmath>
#include<stdlib.h>
#define esp 0.000001
using namespace std;
int main()
{
int n,i;
float sum=0;
for(i=1;i<+5;i++)
{
cout<<"enter the number "<< i<<endl;
cin>>n;
if(n==0)
{
cout<<"zero is not define";
continue;
}
sum=sum+1/n;
}
cout<<"the sum is"<<sum<<endl;
}
No comments:
Post a Comment