NorTheR 0 Denunciar post Postado Novembro 26, 2006 pq isso não funciona?int main () {int x,y;double xy;x=1;y=3;xy=x/y;printf("%lf\n\n",xy);ele só retorna resultados se o resultado for int.. como 1/3 é float ele não faz nada, aff, alguem sabe uma saida pra isso fora fazer x e y double tbm? Compartilhar este post Link para o post Compartilhar em outros sites
Juliano.net 2 Denunciar post Postado Novembro 26, 2006 Olha se isto resolve: #include<iostream>#include<conio.h>#include<stdio.h>int main(){ int a=5,b=2; double res; res = double(a)/double(b); printf("%f",res); getche(); return 0;} Compartilhar este post Link para o post Compartilhar em outros sites
NorTheR 0 Denunciar post Postado Novembro 27, 2006 Perfeito, valeu! http://forum.imasters.com.br/public/style_emoticons/default/joia.gif Compartilhar este post Link para o post Compartilhar em outros sites