GeekInterview.com
Series: Subject: Topic:
Question: 2 of 45

how to write program to print descending order

Asked by: RoshanAshsih | Member Since Jun-2011 | Asked on: Jun 15th, 2011

View all questions by RoshanAshsih

Showing Answers 1 - 1 of 1 Answers
Sandhya.Kishan

Answered On : Jun 15th, 2012

View all answers by Sandhya.Kishan

Here is a program to print first n odd numbers in descending order

#include
main()
{
int i=0,j=0,n;
printf("Enter a number:");
scanf("%d",&n);
printf("The first %d odd numbers are:-
");
for(i=0;i<=n;i++)
{
if(j%2!=0)
printf("%d
"j);
j=j+1;
}
}

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.