Home > database >  Passing the man can help me to look at the code have what problem
Passing the man can help me to look at the code have what problem

Time:09-20

#include
#include
#include

Int main ()
{
Int j, I, a, b;
a=0;
B=0;
Srand ((unsigned) (time (NULL)));
for(j=0; J<100; J++)
{
I=rand () % 11;
Printf (" % d ", I);
}
If (I % 2==0)
B++;
The else
a++;
{
Printf (" odd number is % d, the even number is % d ", a, b);
}
return 0;
}
Why the 100 number is there, as a result, it says odd one even zero

CodePudding user response:

You have the wrong place, brackets only + was over, b++
A little change:
 # include & lt; stdio.h> 
#include
#include

Int main ()
{
Int j, I, a, b;
A=0;
B=0;
Srand ((unsigned) (time (NULL)));
For (j=0; J & lt; 100; J++)
{
I=rand () % 11;
Printf (" % d \ n ", I);

If (I % 2==0)
B++;
The else
a++;
}
{
Printf (" odd number is % d, the even number is % d ", a, b);
}
return(0);
}

http://www.dooccn.com/cpp/

CodePudding user response:

reference 1/f, gypsy song response:
brackets you have the wrong place, only + was over, b++
A little change:
 # include & lt; stdio.h> 
#include
#include

Int main ()
{
Int j, I, a, b;
A=0;
B=0;
Srand ((unsigned) (time (NULL)));
For (j=0; J & lt; 100; J++)
{
I=rand () % 11;
Printf (" % d \ n ", I);

If (I % 2==0)
B++;
The else
a++;
}
{
Printf (" odd number is % d, the even number is % d ", a, b);
}
return(0);
}

http://www.dooccn.com/cpp/

Thank you for your kind

CodePudding user response:

The
hey hey reference 2 floor? (? ` н '?)? Response:
Quote: refer to 1st floor gypsy song response:
brackets you have the wrong place, only + was over, b++
A little change:
 # include & lt; stdio.h> 
#include
#include

Int main ()
{
Int j, I, a, b;
A=0;
B=0;
Srand ((unsigned) (time (NULL)));
For (j=0; J & lt; 100; J++)
{
I=rand () % 11;
Printf (" % d \ n ", I);

If (I % 2==0)
B++;
The else
a++;
}
{
Printf (" odd number is % d, the even number is % d ", a, b);
}
return(0);
}

http://www.dooccn.com/cpp/

Thank you for your kind

You're welcome, nothing to post bar,

CodePudding user response:

reference gypsy song reply: 3/f
Quote: hey hey reference 2 floor? (? ` н '?)? Response:

Quote: refer to 1st floor gypsy song response:
brackets you have the wrong place, only + was over, b++
A little change:
 # include & lt; stdio.h> 
#include
#include

Int main ()
{
Int j, I, a, b;
A=0;
B=0;
Srand ((unsigned) (time (NULL)));
For (j=0; J & lt; 100; J++)
{
I=rand () % 11;
Printf (" % d \ n ", I);

If (I % 2==0)
B++;
The else
a++;
}
{
Printf (" odd number is % d, the even number is % d ", a, b);
}
return(0);
}

http://www.dooccn.com/cpp/

Thank you for your kind

You're welcome, nothing to post bar,

Er node post how ah you _ I seem to have never junction post  nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related