Wednesday, October 28, 2015

Excel element no to sheet address program in c

#include<stdio.h>
main()
{
 int n,a[20],r,i=0,j;
 clrscr();
 printf("enter element:\n");
 scanf("%d",&n);
 while(n>0)
 {
  r=n%26;
  if(r==0)
  {
   r=26;
   n=n-1;
  }
  a[i]=r;
  i++;
  n=n/26;
 }
 for(j=i-1;j>=0;j--)
  printf("%c",a[j]+64);
 getch();
} 

No comments:

Post a Comment