print first nodd numbers in descending order

Answer Posted / dudelzy

#include <iostream>

using namespace std;

int main()
{
int num, x;
cout << "No. of odd numbers u want to find ";
cin >> num;
cout << "" << endl;
for(x = num; x <= num; x--){
if(x % 2 == 1){
cout << x << endl;
}
}
return 0;
}

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many static variables are created if you put one static member into a template class definition?

565


Explain what data encapsulation is in c++?

567


Describe the syntax of single inheritance in C++?

641


Explain mutable storage class specifier.

622


What is array give example?

588






What are the extraction and insertion operators in c++?

559


Show the declaration for a pointer to function returning long and taking an integer parameter.

572


What is object oriented programming (oop)?

619


What is jump statement in C++?

613


What's the order in which the local objects are destructed?

834


Describe about storage allocation and scope of global, extern, static, local and register variables?

730


What does h mean in maths?

564


What is virtual destructor ans explain its use?

599


What does obj stand for?

625


What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

578