Advertisement
Arfizato

rosy cutie

Dec 30th, 2021
1,265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.05 KB | None | 0 0
  1. #include <stdio.h>
  2. main()
  3. {
  4.  
  5.     int A,B,C,produit,somme,pg,pp,fact,i;
  6.  
  7.     printf("donnez 1er entier:\t");
  8.     scanf("%d",&A);
  9.     printf("donnez 2eme entier:\t");
  10.     scanf("%d",&B);
  11.     printf("donnez 3eme entier:\t");
  12.     scanf("%d",&C);
  13.  
  14.     somme=A+B+C;
  15.     produit=A*B*C;
  16.     printf("\nla somme des %d %d et %d est:\t%d",A,B,C,somme);
  17.     printf("\nle produit des %d %d et %d est:\t%d",A,B,C,produit);
  18.  
  19.     if (B<A){
  20.         if(C<A){
  21.             pg=A;
  22.         }else{
  23.             pg=C;
  24.         }
  25.     }else{
  26.         if (C<B){
  27.             pg=B;
  28.         }else{
  29.             pg=C;
  30.         }
  31.     }
  32.     printf("\nle plus grand est:\t%d",pg);
  33.  
  34.     if (A<B){
  35.         if(A<C){
  36.             pp=A;
  37.         }else{
  38.             pp=C;
  39.         }
  40.     }else{
  41.         if (B<C){
  42.             pp=B;
  43.         }else{
  44.             pp=C;
  45.         }
  46.     }
  47.  
  48.     printf("\nle plus petit est:\t%d",pp);
  49.  
  50.     fact=1;
  51.     for (i=1 ; i<=A ; i++)
  52.         {
  53.             fact=fact*i;
  54.  
  55.         }
  56.     printf("\nfactorielle de %d est:\t %d",A,fact);
  57. }
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement