Pages

Les types de données avec la fonction scanf

dimanche 10 novembre 2013

Spécificateurs de format pour scanf

Type SymboleLecture
int %dentier relatif
long %ldlong entier
float/double %lfrationnel en notation décimale ou exponentielle (scientifique)
char %ccaractère
string (char*) %schaî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
 

Most Reading

Stats