Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab4_229

Snippet info

Language

Cpp

Visibility

public

Author

matho.camara

Created

2018-10-30T17:23:09Z

Updated

2018-11-07T08:38:58Z

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

int main() {
   double a,b;
   cout<<"Input a and b values: [a,b]"<<endl;
   cin>>a>>b;
   
   //computing the result
   cout<<"Result:"<<endl;
   cout<<"X\t|\tF(x)"<<endl;
   cout<<"----------------------"<<endl;
   if(a<=380 && b<=380)
   {
       //a values has to be greater than b value
       double temp;
       if(b>a)
       {
          cout<<"Error, a value has to be greater than b ."<<endl;
       }
       else
       {
          for(int i=a;i<=b;i++)
           {
               cout<<i<<">>"<<"\t|\t"<<sin(i)-cos(i)<<endl;
           }  
       }
       
   }else
   cout<<"Error, input a correct angle value."<<endl;
    return 0;
}
INFO