Professional Documents
Culture Documents
Travail Malak
Travail Malak
#include<iostream>
using namespace std;
int main ()
{
int a ;
cout<<"type your first variable";
cin>>a;
cout<<"your first variable is : "<<a<<endl ;
int b ;
cout<<"type your second variable";
cin>>b;
cout<<"your second variable is : "<<b<<endl;
rutern 0 ;
}
Exo 2
#include<iostream>
using namespace std;
int main ()
{
int a=9,i=1;
{
cout<<"the variable of i is:"<<i<<endl;
i=i+1;
}
return 0;
}
#include<iostream>
using namespace std;
int main ()
{
int a,b, min ;
cout<<"type a variable "<<endl;
cin>>a;
cout<<"type a second variable "<<endl;
cin>>b;
min= a,b;
for(int i=3;i<=10;i=i+1)
{
cout<<"type an other variable"<<endl;
cin>>a;
if (min>a,b)
min=a,b;
}
cout<<"the the smallest value is:"<<min;
return 0;
}
Exo 3
//2 eme methode
/* #include<iostream>
using namespace std;
int main ()
{
int a,b,c,d,e,f,j,h,i,g, min ;
cout<<"type the first variable "<<endl;
cin>>a;
cout<<"type a second variable "<<endl;
cin>>b;
cout<<"type an other variable "<<endl;
cin>>c;
cout<<"type an other variable "<<endl;
cin>>d;
cout<<"type an other variable "<<endl;
cin>>e;
cout<<"type an other variable "<<endl;
cin>>f;
cout<<"type an other variable "<<endl;
cin>>j;
cout<<"type an other variable "<<endl;
cin>>h;
cout<<"type an other variable "<<endl;
cin>>i;
cout<<"type the last variable "<<endl;
cin>>g;
min= a,b,c,d,e,f,j,h,i,g;
return 0; */
}
Exo 4
#include<iostream>
using namespace std;
int main ()
{
int N,u=3,i;
return 0;
}
Exo 5
#include<iostream>
using namespace std;
int main ()
{
int x=0,choix;
do
{
cout<<"x vaut"<<x<<endl;
cout<<"1:ajouter 1"<<endl;
cout<<"2:multiplier par 2"<<endl;
cout<<"3:soustraire 4"<<endl;
cout<<"4:quitter"<<endl;
cout<<"votre choix:";cin>>choix;
switch(choix)
{
case 1:x++; break;
case 2:x=x*2; break;
case 3:x=x-4; break;
}
}
while(choix=4);
cout<<"la valeur finale de x vaut :"<<x<<endl;
return 0;
}
Exp 7