If we have this :
the out put would be like that:Code:#include <iostream.h> #include <stdlib.h> int main() { const int size=7; int a[size]={0}; for( int i=1; i<600; i++) ++a[1+ rand()%6]; cout<<a[i]<<endl; for(int j=0; j<size; j++) cout<<a[j]<<" ";
why the value of the array remained 0 while i have already incremet it and also i have used rand()???Code:0 9404 9063 14109 9306 18378 9454
and wut are these numbers when the array is being printed in the second loop? why the each cell contains 4 or more numbers? why not one number? and why does it conttain 7, 8 and 9 if i used the rand() of range (0-6)?????????
anyone can tell me?![]()



LinkBack URL
About LinkBacks
If we have this :




CornedBee