SOURCE CODE OUTPUT
#include<iostream>
using namespace std;
int main()
{
long d,n,a1;
float an;
cout<<"Enter first term ";
cin>>a1;
cout<<"Enter difference ";
cin>>d;
cout<<"Enter nth term ";
cin>>n;
cout<<n<<"th term of H.P. : ";
an=a1+(n-1)*d;
cout<<"1/"<<an<<" ";
return 0;
}
using namespace std;
int main()
{
long d,n,a1;
float an;
cout<<"Enter first term ";
cin>>a1;
cout<<"Enter difference ";
cin>>d;
cout<<"Enter nth term ";
cin>>n;
cout<<n<<"th term of H.P. : ";
an=a1+(n-1)*d;
cout<<"1/"<<an<<" ";
return 0;
}
Any questions regarding to program please write in comments.
No comments:
Post a Comment