a et b sont des entiers, a = -21430b = 4782, calculer et afficher a+b, a-b, a*b, a/b, a%b en format décimal, et en soignant l'interface homme/machine.
a/b donne le quotient de la division, a%b donne le reste de la division.
Correction
#include <stdio.h>
#include <conio.h>
void main()
{
int a,b;
a= -21430;
b= 4782;
printf("A + B = %d\n",a+b);
printf("A - B = %d\n",a-b);
printf("A x B = %d\n",a*b);
printf("A sur B = %d\n",a/b);
printf("A mod B = %d\n",a%b);
puts("Pour continuer frapper une touche...");
getch(); /* Attente d'une saisie clavier */
}
Aucun commentaire:
Enregistrer un commentaire