Skip to content

Instantly share code, notes, and snippets.

@Ambratolm
Last active June 25, 2017 11:17
Show Gist options
  • Save Ambratolm/eeb5e267a95cd365b8c4b8ecea9f2535 to your computer and use it in GitHub Desktop.
Save Ambratolm/eeb5e267a95cd365b8c4b8ecea9f2535 to your computer and use it in GitHub Desktop.
Ecrire un algorithme qui demande de saisir un nombre puis calcule et affiche son carré.
#include<stdio.h>
main()
{
printf("Carré d'un nombre réel:\n");
printf("--------------------------------\n");
float x,X;
printf("Entrez le nombre: ");
scanf("%f",&x);
printf("--------------------------------\n");
X=x*x;
printf("Le carré de %f est: %f\n", x,X);
printf("--------------------------------\n");
system("pause");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment