print first nodd numbers in descending order

Answer Posted / radhakrishnan

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 ?    3 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between while and do while loop?

666


What are the uses of static class data?

737


What are dynamic type checking?

694


What is the use of class in c++?

661


What is lambda in c++?

671






Differentiate between a constructor and a destructor in c++.

649


What is a .lib file in c++?

641


Explain this pointer?

681


Can you declare an array without a size in c++?

669


If a header file is included twice by mistake in the program, will it give any error?

645


What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.

667


How would you find out if a linked-list is a cycle or not?

640


If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?

693


What are virtual functions in c++?

785


What is the c++ programming language used for?

665