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

Why should you learn c++?

672


what is data encapsulation in C++?

703


What are single and multiple inheritances in c++?

667


What is runtime polymorphism in c++?

684


Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()

1122






How do I write a c++ program?

685


How will you call C functions from C ++ and vice-versa?

748


When is the copy constructor called?

729


What are special characters c++?

653


What is encapsulation in c++?

769


What is a tree in c++?

635


Explain the volatile and mutable keywords.

716


What is the purpose of the "delete" operator?

701


Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.

2184


What are put and get pointers?

697