63 814
Assignments Done
99,5%
Successfully Done
In August 2018

Answer to Question #28971 in C# for Sharmila Rani

Question #28971
Program to generate odd No. 1 to 50 exp 17
Expert's answer
#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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions