পোস্টগুলি

আগস্ট, ২০১৯ থেকে পোস্টগুলি দেখানো হচ্ছে

video

Video:  Update......  

Decimal to Hexadecimal number conversino

Decimal to Hexadecimal number conversion: code: #include<stdio.h> int main() {     int num,i,j,g[10];     scanf("%d",&num);     char h[6];     h[0]='A';     h[1]='B';     h[2]='C';     h[3]='D';     h[4]='E';     h[5]='F';     for(i=0;num!=0;i++)     {         g[i]=num%16;         num=num/16;     }     for(i=i-1;i>=0;i--)     {         if(g[i]>9)         {             j=g[i]-10;             printf("%c",h[j]);         }         else   ...

Decimal to Octal number in c

Decimal to Octal number conversion: Code: #include<stdio.h> int main() {     int num,i;     scanf("%d",&num);     if(num>=0)     {         for(i=1;i<=num;i*=8)         {}         for(i/=8;i!=1;i/=8)         {             printf("%d",num/i);             num%=i;         }         printf("%d",num);     }     else     {         printf("Can not calculate.\n");     }     return 0; }

About Me

ছবি
About Me: I am Md. Bayazid Hossain .From Bogura ,Rajshahi ,Bangladesh.I am studing B. Sc. Engineering on Computer Science and Engineering( CSE ) at Pabna University of Science and Techanology( PUST ). This is my personal blog for sharing code.

Decimal to binary equivalent in c.

code: #include <stdio.h> int main() {     int dn,i;     scanf("%d",&dn);     for(i=1;i<=dn;i*=2)     {}     for(i/=2;i!=1;i/=2)     {         printf("%d",dn/i );         dn=dn%i;     }     printf("%d",dn);     return 0; } Discussion: In this program it use the easies formula to convert decimal to binary. The formula is:                          n ……. 64 32 16 8 4 2 1 calculate the nearby value of the given decimal number in this series.When the decimal value are first time divided by the series value it will be started count. Then print the division result and calculate the modulus for these number and assigned in it. For Example: where decimal number is 17 step 1: Nearby value of ...