نوشته شده توسط emad_67 اینو ببین: #include<iostream.h> void main() { float x=25.31454; int n=x,count=0; float y=x; while(n>0) { n/=10; count++; } cout<<"sahih :"<<count<<endl; count=0; while(int(y)!=y) { y*=10; count++; } cout<<"Ashar :"<<count<<endl; } این کد ایراد داره اگه عدد 6.6566 رو وارد کنید خروجی 7 میده چرا؟
#include<iostream.h> void main() { float x=25.31454; int n=x,count=0; float y=x; while(n>0) { n/=10; count++; } cout<<"sahih :"<<count<<endl; count=0; while(int(y)!=y) { y*=10; count++; } cout<<"Ashar :"<<count<<endl; }
قوانین سایت