Answer to Question #28971 in C# for Sharmila Rani

Question #28971
Program to generate odd No. 1 to 50 exp 17
1
Expert's answer
2013-04-26T10:59:44-0400
#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 the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS