What's New-Given Below
technicalsymposium
technicalsymposium
technicalsymposium

C/C++ Lab Program(s)/Materials

C Program For ORDER OF NUMBERS.

/* N=321 AND RESULT=123*/

#include<stdio.h>
#include<conio.h>
void main()
{
int n,t,z=1,i,j,a[20];
clrscr();
printf("Enter any number:");
scanf("%d",&n);
while(n>0)
{
t=n%10;
a[z]=t;
z++;
n=n/10;
}
for(i=1;i<=z;i++)
{
for(j=i+1;j<=z;j++)
{
if(a[i]>a[j])
{
t=a[i];
a[i]=a[j];
a[j]=t;
}
}
}
for(i=2;i<=z;i++)
{
printf("%d",a[i]);
}
getch();
}

More Lab Programs with Answers -Given Below-Click and Get Freely

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com