print first nodd numbers in descending order

Answer Posted / prk

void main()
{
int i,n,k;
cout<<"Enter the number:";
cin>>n;
k=n%2;
if(k==0)
n=n-1;

for(i=n;i<=n;i=1-2)
cout<<1;
}

Is This Answer Correct ?    9 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Discuss the possibilities related to the termination of a program before entering the mainq method?

534


Write about all the implicit member functions of a class?

590


Why c++ is faster than java?

590


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

564


Is main a class in c++?

554






Explain terminate() and unexpected() function?

620


Is c++ a float?

596


What are put and get pointers?

577


What are the various operations performed on stack?

625


What is dynamic and static typing?

665


How many ways can a variable be initialized into in C++?

592


What is the use of c++ programming language in real life?

558


What is linked list in c++?

686


What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass

674


Differentiate between the manipulator and setf( ) function?

588