Why output showing 0 instead of 0.0?
I declared an array of 10 elements and initialized it with 0.0 .. 9.9 ,
its output is perfect except 0.0 has been changed into 0, why is it so?
#include <iostream>
using namespace std;
int main(void)
{
int const SIZE = 10;
double number[SIZE] = {0.0,1.1,2.2,3.3,4.4,5.5,6.6,7.7,8.8,9.9};
for(int i(0) ; i < SIZE ; i++)
{
cout << number[i] << endl ;
}
system("PAUSE");
}
Thanks,
No comments:
Post a Comment