Search This Blog

Thursday, October 13, 2011

Write a program to display decimal numbers 0 through 16 in decimal, octal and hexadecimal

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  void main()
   4:  {
   5:  int k;
   6:  pritf("\nDecimal Octal Hexadecimal");
   7:  for(k=0;k<=16;k++)
   8:  printf("%5d %5o %5x",k,k,k);
   9:  getch();
  10:  }

No comments:

Post a Comment