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

What is vectorial capacity?

658


What is difference between class and structure in c++?

629


What is a literal in c++?

571


Can comments be longer than one line?

633


Do class declarations end with a semicolon? Do class method definitions?

628






Why c++ does not have finally?

605


What are the advantages of using pointers in a program?

689


What is purpose of new operator?

606


What are maps in c++?

514


What is a class template in c++?

533


What is time_t c++?

619


What is c++ virtual inheritance?

606


What is c++ prototype?

597


What is the best book for c++ beginners?

590


Explain the auto storage classes in c++.

612