print first nodd numbers in descending order

Answer Posted / nagarajan n.

int n;
cout<<"enter a num:";
cin>>n;
for(int i=n;i>=1;i--)
{
if((i%2)!=0)
{
cout<<i<<"/t";
}
}

Is This Answer Correct ?    50 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does java differ from c and c++?

535


What are shallow and deep copies?

629


How java is different from c and c++?

635


Why is c++ considered difficult?

641


What are the rules for naming an identifier?

556






the maximum length of a character constant can be a) 2 b) 1 c) 8

600


What are the unique features of C++.

567


What is prototype in c++ with example?

561


Can we use pointers in c++?

606


Define friend function.

566


How do you generate a random number in c++?

603


When should I use unitbuf flag?

586


What is stl containers in c++?

583


What is #include math h in c++?

572


What are the advantages of pointers?

594