print first nodd numbers in descending order

Answer Posted / vaishnavi

#include<iostream.h>
void main()
{
int i,n;
cout<<"Enter the number:"
cin>>n;
for(i=2*(n-1);i>=1;i=i-2)
{
cout<<i;
}
}

Is This Answer Correct ?    8 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is implicit pointer in c++?

701


What are manipulators in c++ with example?

676


What is a tree in c++?

635


What is the latest c++ standard?

771


What do c++ programmers do?

653






What is the use of volatile variable?

687


Define pure virtual function?

643


By using c++ with an example describe linked list?

688


How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?

676


Where must the declaration of a friend function appear?

638


What does the linker do?

690


What is the real purpose of class – to export data?

718


What is problem with overriding functions?

674


What is else syntax in c++?

736


What is this pointer in c++?

868