Comprendre un programmme
fati56
Messages postés
24
Statut
Membre
-
Char Snipeur Messages postés 10112 Date d'inscription Statut Contributeur Dernière intervention -
Char Snipeur Messages postés 10112 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
je cherche a comprendre l'utilité ou l'explication du programme suivant alors si quelqu'un aura la gentillesse de m'aider ca sera super:
#include <stdio.h>
#define INT30 30
#define INT60 60
#define FLO20 20
#define FLO40 40
#define INDIC INT30
main()
{
char c;
int i;
unsigned int u;
float f;
for (c = 'A'; c < 'E'; c++)
{
printf("%c ", c);
#if INDIC == INT30
for (i = 1; i <= 30000; i++);
#elif INDIC == INT60
for (u = 1; u <= 60000; u++);
#elif INDIC == FLO20
for (f = 1.0; f <= 2000.0; f++);
#elif INDIC == FLO40
for (f = 1.0; f <= 4000.0; f++);
#else
for (u = 1; u <= 45000; u++);
#endif
}
getch();
}
merci d'avance.
je cherche a comprendre l'utilité ou l'explication du programme suivant alors si quelqu'un aura la gentillesse de m'aider ca sera super:
#include <stdio.h>
#define INT30 30
#define INT60 60
#define FLO20 20
#define FLO40 40
#define INDIC INT30
main()
{
char c;
int i;
unsigned int u;
float f;
for (c = 'A'; c < 'E'; c++)
{
printf("%c ", c);
#if INDIC == INT30
for (i = 1; i <= 30000; i++);
#elif INDIC == INT60
for (u = 1; u <= 60000; u++);
#elif INDIC == FLO20
for (f = 1.0; f <= 2000.0; f++);
#elif INDIC == FLO40
for (f = 1.0; f <= 4000.0; f++);
#else
for (u = 1; u <= 45000; u++);
#endif
}
getch();
}
merci d'avance.