Wednesday 27 March 2013

Find the Hexa decimal value of Decimal value using C programm

#include<stdio.h>
#include<conio.h>
void main()
{
   int  a,no,i=0,*p;
   clrscr();
   printf("\tEnter your value which you want get Hexadecimal value.\n");
   printf("\n\n\tPlease enter your value here.\n");
   scanf("%d",&no);
while(no>i)
   {
    a=no%16;
    if(a<=9)
    printf(" %d",a);
    else
    break;
    no=no/16;
    }
switch(no)
      {
      case 10:
      no='A';
      printf("%c",no);
      break;
      case 11:
      no='B';
      printf("%c",no);
      break;
      case 12:
      no='C';
      printf("%c",no);
      break;
      case 13:
      no='D';
      printf("%c",no);
      break;
      case 14:
      no='E';
      printf("%c",no);
      break;
      case 15:
      no='F';
      printf("%c",no);
      break;
      default:
      printf("%d",no);
      break;
      }
getch();
}


No comments:

Post a Comment

How to change Background color by selecting color from Listview

activitymain.xml file::> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     xm...