You are on page 1of 2

EXO 02:

include <iostream>
using namespace std;
float absolute(float x)
{
if (x< 0)
return (-1.x);
return x:
}
float sine(Float *) {
/ assuming x in radians
float result, old result;
const float epsilon = 10E-6;
int k= 0;
float divisor term;
term = X;
result-X;
divider = 1;
do {

old_result - result;
divider = divider (2*k + 2) • (2*k + 3);
++k;
term –term *x*x;
result = result + (term / divider);
}
whlle( absolute((result - old_result) ) > epsilon
return result;
}
int main() {
float x;
cin>>x;
cost e sinus(x);
}
EXO 3:
#include <iostream>
using namespace std;
intmain()
{int n;
cin >> n;
int tab[n];
for(int i = 0; i <n; i++) {
cout<<"enter a value: ";
cin>>tab[i];
}
for(int i = 0; i <1; i++){
for(int j = i+1; j < n; j++) {
int t = tab[i];
tab[i] = tab[j];
tab[j ] = t;}
}
for(int i = 0; i < n; i++) {
cout<< tab[i]<< endl;
}

You might also like