Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab1_44

Snippet info

Language

Cpp

Visibility

public

Author

matho.camara

Created

2018-10-13T15:28:43Z

Updated

2018-10-24T08:25:09Z

#include <iostream>
#include <math.h>
using namespace std;

//вариант 44
int main() {
   double result;
  int x;
  //collecting data
  cout<<"Input X value:"<<endl;
  cin>>x;

  //controling the data
  if(x>0)
  {
	  //computing the result
	  result=(sqrt(x+1)+sqrt(x-1))/(2*sqrt(x));

	  cout<<"The result is :"<<result<<endl;
  
  }else
	  cout<<"Error, input a correct number"<<endl;
    return 0;
}
INFO