Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Ambratolm/9947c02fe0e50ffe466c58c03829ec17 to your computer and use it in GitHub Desktop.
Save Ambratolm/9947c02fe0e50ffe466c58c03829ec17 to your computer and use it in GitHub Desktop.
Ecrire un algorithme qui calcule et affiche la surface et le périmètre d’un rectangle dont on lui donne la longueur et la largeur.
#include<stdio.h>
main()
{
printf("================================\n");
printf("Surface et périmètre d'un rectangle:\n");
printf("================================\n");
float l,L,S,P;
printf("Entrez la largeur : ");
scanf("%f",&l);
printf("Entrez la longueur : ");
scanf("%f",&L);
S=l*L;
P=2*(l+L);
printf("________________________________\n");
printf("La surface est: %f\nLe périmètre est: %f\n", S,P);
printf("________________________________\n");
system("pause");
}
@marwa22-ghz
Copy link

Uploading IMG20231211211803.jpg…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment