60 475
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #4726 in C++ for angel

Question #4726
write a c++ program for generate odd number
Expert's answer
#include "stdafx.h"
#include "conio.h"
#include <iostream>
#include <cstdlib>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
int number;
cout<<"Enter how many number generate? : ";
cin>>number;
int count=0;
for(;;){

& int random_integer = rand()%500;
& if(random_integer%2==1){
& count+=1;
cout <<count <<" odd number is "<< random_integer << endl;
& }
& if(count==number){
& break;
& }
&
}
& & getch();
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