Program to generate odd No. 1 to 50 exp 17
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <math.h>
using namespace std;
int main()
{
int a =& rand() %50; //generate random variable
int c=a/2;
int& d=0;
d= fabs(c); & // absolute value c
int b=a-2*d; // if d=*.0 then b is even number, and then our number - 2*d =0
if(b=!0){ // if d!=*.0 then b is odd number, and then our number - 2*d !=0
cout << b<<a<< endl;}
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C#