C Program to sort a list of names

#include "stdio.h"
void main ()
{
  int i, j, n;
  char name[30][30], temp;
  clrscr ();
  printf ("\tProgram to sort a list of names\n\n");
  printf ("Enter the total no. of names less than 30\n");
  scanf ("%d", &n);
  printf ("Please enter the names\n");
  for (i = 0; i < n; i++)
  {
    scanf ("%s", name[i]);
  }
  /*Sorting Process Start*/
  for (i = 0; i < n; i++)
  {
    for (j = i + 1; j < n; j++)
    {
      if (strcmp ( name[i], name[j] ) > 0)
      {
    strcpy ( temp, name[i] );
    strcpy ( name[i], name[j] );
    strcpy ( name[j], temp );
      }
    }
  }
  /*Sorting Process End*/
  printf ("\nSorted list\n");
  printf ("**************");
  for (i = 0; i < n; i++)
  {
    printf ( "\n%s", name[i] );
  }
  getch ();
}

C Program to sort N numbers in ascending order

#include "stdio.h"
void ascending (int[30]);
int limit;
void main ()
{
     int a, num[30];
     clrscr ();
     printf ("\nProgram for sorting numbers in Ascending order");
     printf ("\n\n\nHow many numbers you are going to enter?\n");
     scanf ("%d", &limit);
     printf ("\nPlease enter the numbers\n");
     for (a = 0; a < limit; a++)
    {
        scanf ("%d", &num[a]);
     }
     ascending (num);
     getch ();
}

void ascending (int n[30])
{
     int a, b, temp;
     for (a = 0; a < limit; a++)
     {
          for (b = 0; b < limit; b++)
          {
               if (n[a] < n[b])
               {
                     temp = n[a];
                     n[a] = n[b];
                     n[b] = temp;
                }
           }
     }
     printf ("\nAscending order of the number:-\n");
     for (a = 0; a < limit; a++)
     {
          printf ("\n%d", n[a]);
     }
}

C Program to convert a decimal number to its binary number

#include "stdio.h"
#include "math.h"
void converter (int);
void main ()
{
  int decimal;
  clrscr ();
  printf ("Program to convert a decimal number to binary\n\n");
  printf ("Please enter a decimal number\n");
  scanf ("%d", &decimal);
  converter (decimal);
  getch ();
}
void converter (int decimal)
{
  int bin = 0, d, i = 0;
  while (decimal > 0)
  {
    d = decimal % 2;
    bin = bin + d * pow (10, i);
    ++i;
    decimal = decimal / 2;
  }
  printf ("Binary number:%d", bin);
}