Skip to content

Instantly share code, notes, and snippets.

@Ambratolm
Created June 24, 2017 21:57
Show Gist options
  • Save Ambratolm/b03b9c971ad9b8cb90528e07cae63a10 to your computer and use it in GitHub Desktop.
Save Ambratolm/b03b9c971ad9b8cb90528e07cae63a10 to your computer and use it in GitHub Desktop.
Ecrire un algorithme qui calcul la somme, la soustraction, la multiplication et la division de deux nombres entiers a et b.
#include<stdio.h>
main()
{
printf("Opérations arithmétiques sur deux nombres entiers:\n");
printf("--------------------------------\n");
int a,b,S,So,M,D;
printf("Entrez le premier nombre: ");
scanf("%d",&a);
printf("Entrez le deuxième nombre: ");
scanf("%d",&b);
printf("--------------------------------\n");
S=a+b;
So=a-b;
M=a*b;
D=a/b;
printf("Somme: %d\nDifférence: %d\nMultipliant: %d\nQuotient: %d\n", S,So,M,D);
printf("--------------------------------\n");
system("pause");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment