Spécificateurs de format pour scanf
Ex1:
| Type | Symbole | Lecture |
| int | %d | entier relatif |
| long | %ld | long entier |
| float/double | %lf | rationnel en notation décimale ou exponentielle (scientifique) |
| char | %c | caractère |
| string (char*) | %s | chaîne de caractères |
*Exemple:
Ex1:
#include <stdio.h>
#include <conio.h>
int main()
{
int A;
printf("Entrez un nombre : ");
scanf("%d", &A);
printf("le Nombre est : %d",A);
getch();
return 0;
}
Ecran:Entrez un nombre : (ex:26)
le Nombre est : 26
#include <conio.h>
int main()
{
int A;
printf("Entrez un nombre : ");
scanf("%d", &A);
printf("le Nombre est : %d",A);
getch();
return 0;
}
Ecran:Entrez un nombre : (ex:26)
le Nombre est : 26