En ce momentGenshin ImpactValhallaBreath of the wildAnimal CrossingGTA 5Red dead 2
Liste des sujets
Langage c 3
Desaccro
Niveau 6
31 août 2015 à 17:58:29
Bonjour un autre problème voilà :
#include <stdio.h>
int main() { int a ,b, c;
a = 5; b = 7; c = a+b; printf("Variable c=%d\n", c); return(0); } je veux diviser a par b ça me met 0 et quand j'utilise float ça me met -1073741824 donc comment faire
Merci
Candystand
Niveau 10
31 août 2015 à 18:00:18
t'aurais pu continuer sur le même topic
Bref pour ton problème, %d permet l'affichage d'un ENTIER, donc un int. Si tu utilises un float, tu dois utiliser %f dans ton printf, à la place de %d.