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 object in c++ wikipedia?

575


Describe private, protected and public?

609


What are the two shift operators and what are their functions?

574


How new/delete differs from malloc()/free?

628


What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack

601






What is guard code in c++?

652


What is the difference between passing by reference and passing a reference?

576


What is extern c++?

536


What jobs can you get with a c++ certification?

598


Do class method definitions?

597


write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num

2209


what are function pointers?

588


Do you know what are pure virtual functions?

646


Which of the following is evaluated first: a) && b) || c) !

1820


Do vectors start at 0 c++?

539