Professional Documents
Culture Documents
Yassine Ouardini Control 1
Yassine Ouardini Control 1
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause")
or input loop */
int a ;
int b ;
int main(int argc, char *argv[]) {
if ( a < b ){
printf("le minimum est : %d ",a);}
else {
printf("le minimum est : %d ",b);
}
getch();
return 0;
}
Exercice 2 :
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause")
or input loop */
int a ;
int b = -1 ;
void absolu () ;
int main(int argc, char *argv[]) {
absolu () ;
getch();
return 0;
}
if ( a < 0 ){
printf("le nombre absol� est : %d ",a * b);}
else {
printf("le nombre est : %d ",a);
}
exercice 3 :
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause")
or input loop */
int T[22];
int a = 3 ;
int i ;
int main(int argc, char *argv[]) {
for (i=0 ; i <= 20 ; i++ ){
exercice 4 :
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause")
or input loop */
int T[6];
int a = 3 ;
int i ;
int somme ;
int moyenne ;
int max = 0 ;
int main(int argc, char *argv[]) {
for (i=0 ; i < 6 ; i++ ){
}
printf ("la somme est : %d ",somme);
moyenne = somme /T[i] ;
printf ("\nla moyenne est : %d ",moyenne);
printf ("\nle max est : %d ",max);
getch();
return 0;
}