Wrox Programmer Forums
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2004, 03:42 AM
Registered User
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can any1 help me?!

anyone here help me make a program that will sort five numbers in ascending order?

 
Old July 6th, 2004, 01:47 AM
Registered User
 
Join Date: Jun 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

#include<stdio.h>

main()
{
int a[5] = {5,1,10,6,82};
int i,j,temp;
for(i = 0;i<4:i++)
{
for(j = i;j<5;j++)
{
if(a[i]>a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}

for(i = 0;i<5;i++)
printf("\n%d",(a+i));

}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Any1 have a TBH CustomEvents Source? krainov BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 December 28th, 2007 01:54 AM
Any1 no how 2 create 1-2-1 chat rooms? jamalserroukh Javascript How-To 1 May 22nd, 2007 08:43 AM
Can any1 help me out prashanth_a18 C++ Programming 1 September 26th, 2006 05:09 PM
any1 can help me, pls... ck C++ Programming 1 February 24th, 2005 07:51 AM
any1 can help me, pls... ck Visual C++ 1 February 23rd, 2005 09:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.