jdgf

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
int a, b, min, max, c;
srand(time(NULL));
min=0;
max=101;
c=0;

printf("Donnez le nombre mystère\n");
scanf("%d",&a);

do

{
b = (max-min)/2 + min;
printf("%d", b);
if(b<a)
{
printf("Le nombre mystere est superieur a ce nombre\n");
min = b;
c++;
}
else if(b>a)
{
printf("Le nombre mystere est inferieur a ce nombre\n");
max = b;
c++;
}
}
while(a!=b);

printf("L'ordinateur à trouvé le bmbre %d en %d coups, lui c'est un PGM !",a, c);

return 0;
}






#include<stdio.h>
#include<stdlib.h>
#include<time.h>

int main (void)
{
int a, b, c, tmp;

c=0;

srand(time(0));

a=rand()%100;
do
{
do
{
printf("Donnez un nombre :");
scanf("%d", &b);

c=c+1;

if(b<a)
printf("le nombre mystère est supérieur à ce nombre\n");
else if(b>a)
printf("le nombre mystère est inférieur à ce nombre\n");
}
while(b!=a);

printf("Bravo vous avez trouvé le Nombre Mystère en %d étapes!!! \nVoulez vous recommencer ?(Oui:1 NON:0)\n", c);

scanf("%d", &tmp);
}
while(tmp==1);

return 0;
}



#include <stdio.h>

int main (void)
{
int n;
double a, b, c, m;

printf(" donner votre n° d'étudiant:");
scanf("%d", &n);

printf(" donnez vos 3 notes: ");

scanf("%lf %lf %lf", &a, &b, &c);

m=(a+b+c)/3;

printf("Votre moyenne est %f\n", m);

if(m<10)
printf("Echec\n");
else if(m<12)
printf("Mention P\n");
else if(m<14)
printf("Mention AB\n");
else if(m<16)
printf("Mention B\n");
else if(m<20)
printf("Mention TB\n");

return 0;

}





#include <stdio.h>
#include <math.h>
#define PI 3.1416

int main (void)
{
double x;

printf("sin(0)=%f sin(PI/6)=%f sin(PI/3)=%f sin(PI/4)=%f sin(PI/2)=%f racine(2)/2)=%f et racine(3)/2=%f\n", sin(0), sin(PI/6), sin(PI/3), sin(PI/4), sin(PI/2), sqrt(2)/2, sqrt(3)/2);

printf("donnez une valeur réelle x:");
scanf("%lf", &x);

printf("cos(x)=%f sin((PI/2)-x)=%f\n", cos(x), sin((PI/2)-x));

return 0;
}



#include <stdio.h>


int main (void)
{
int t, h, m;

printf("donner la durée en secondes:");
scanf("%d", &t);

h=t/3600;
t=t%3600;
printf("le nombre d'heures est %d\n", h);

m=t/60;
t=t%60;

printf("le nombre de minutes est %d\n", m);

printf("le nombre de secondes est %d\n", t);

return 0;
}

# Posted on Wednesday, 30 September 2009 at 10:16 AM

Edited on Wednesday, 07 October 2009 at 5:58 AM

[ Dash a comment ] [ No comments ]

# Posted on Monday, 02 March 2009 at 7:49 PM

Edited on Saturday, 25 July 2009 at 10:04 AM

[ Dash a comment ] [ No comments ]

# Posted on Monday, 02 March 2009 at 7:48 PM

[ Dash a comment ] [ No comments ]

# Posted on Monday, 02 March 2009 at 7:47 PM

[ Dash a comment ] [ No comments ]

# Posted on Sunday, 01 February 2009 at 3:32 PM

[ Dash a comment ] [ No comments ]

# Posted on Sunday, 01 February 2009 at 3:31 PM

[ Dash a comment ] [ No comments ]

# Posted on Sunday, 01 February 2009 at 3:31 PM

[ Dash a comment ] [ No comments ]

# Posted on Sunday, 01 February 2009 at 3:30 PM

[ Dash a comment ] [ No comments ]

# Posted on Sunday, 01 February 2009 at 3:30 PM

[ Dash a comment ] [ No comments ]

# Posted on Sunday, 01 February 2009 at 3:29 PM