1

بابه‌ت: دروست کردنی بەرنامە بۆ گۆرینی Decimal to hexadecimal,octal,and binary بە ++C

سڵاو بەرێزان....

هەروەک جارانی تر، ئەم جارە بەرنامەیەکی ترتانم بۆ ئامادە کردوون بە ++C، کە هاوشێوە بەرنامەکەی پێشووە ئەوەی کە ژمارەی Decimalی دەگۆری بۆ binary بەڵام لەسەر داواکاری هەندێ بەرێز ئەمجارە بەرنامەکە فراوانتر بووە، ئەم جارەیان Decimal دەگۆرێ بۆ هەرسێ جۆری تر واتا بۆ hexadecimal,octal,and binary
هیوادارم سوودی لێ ببینن. کە ئەمەش کۆدەکەیە:

#include<iostream.h>

void main()
{
  int b[16],hh[16],oct[16],oc,d,i=0,ih=0,io=0,dh,x,h,od,j;

  cout<<"\t\"Converting Decimal to Binary,HexaDecimal,and Octal\"\n\n"
        <<"\nEnter a decimal number to convert it:";
  cin>>d;
  x=d;
  dh=d;
  od=d;
  if (d>=0)
  {
     while(d>0)
     {
        b[i]=d%2;
        d=d/2;
        i++;
     }

     while(dh>0)
     {
        h=dh%16;
        dh=dh/16;
        hh[ih]=h;
        ih++;
     }

     while(od>0)
    {
      oc=od%8;
      od=od/8;
      oct[io]=oc;
      io++;
    }

          if(x!=0)
            {
              cout<<endl
                    <<x
                    <<" in decimal = (";
              for(int j=i-1; j>=0; j--)
                cout<<b[j];
                cout<<") in binary\n";

                cout<<endl
                     <<x
                     <<" in decimal = (";
                for( j=ih-1; j>=0; j--)
                {
                  if (hh[j]==10) cout<<'A';
                  else if (hh[j]==11) cout<<'B';
                  else if (hh[j]==12) cout<<'C';
                  else if (hh[j]==13) cout<<'D';
                  else if (hh[j]==14) cout<<'E';
                  else if (hh[j]==15) cout<<'F';
                  else
                  cout<<hh[j];
                }
                cout<<") in Hexadecimal\n";

                cout<<endl
                     <<x
                     <<" in decimal = (";
              for( j=io-1; j>=0; j--)
                cout<<oct[j];
                cout<<") in Octal\n";
         }
         else
         {  cout<<endl
                     <<x
                     <<" in decimal = (";
            cout<<"0) in Binary,Hexadecimal,and Octal ";
          }
  }
  else
  cout<<"\n\nWrong input.";
}
[center]Technology News [/center]

[center]  " TEACHING OTHERS TEACHES YOU "[/center]

2

وه‌ڵام: دروست کردنی بەرنامە بۆ گۆرینی Decimal to hexadecimal,octal,and binary بە ++C

دەستەکانت خۆشبێت، پرۆگرامێکی بەسوودە، بەهیوای زیاتر.

3

وه‌ڵام: دروست کردنی بەرنامە بۆ گۆرینی Decimal to hexadecimal,octal,and binary بە ++C

دەست خۆش بەهیوای زیاتر

اللهم أحينني ما كنت حياة خيرا لي
و توفيتني اذا كنت وفاة خيرا لي

                                                 خوایه‌ وڵاتم له‌(درۆ و بێ بارانی و نه‌خۆشی)بپارێزه‌..

4

وه‌ڵام: دروست کردنی بەرنامە بۆ گۆرینی Decimal to hexadecimal,octal,and binary بە ++C

دەست خۆش بێت  بەسودە  هەربژی  کاک دژوار

5

وه‌ڵام: دروست کردنی بەرنامە بۆ گۆرینی Decimal to hexadecimal,octal,and binary بە ++C

Thanks alot friends, i'll try to write more useful programs

[center]Technology News [/center]

[center]  " TEACHING OTHERS TEACHES YOU "[/center]

6

وه‌ڵام: دروست کردنی بەرنامە بۆ گۆرینی Decimal to hexadecimal,octal,and binary بە ++C

سڵاو خەیاڵ گیان.
من پێش ئێستا چەند بابەتێک لەسەر ++Cم نوسی بوو لە بەشی کۆمپیوتەرو ئەنتەرنێت، پێم باش بوو کە بیان دانێیتە بەشی دارشتن و  دروست کردنی ماڵپەر بەگشتی.
کە ئەمانەش بابەتەکانن.

http://www.xeyal.net/forum/viewtopic.php?id=3476
http://www.xeyal.net/forum/viewtopic.php?id=3077
http://www.xeyal.net/forum/viewtopic.php?id=1573
http://www.xeyal.net/forum/viewtopic.php?id=1553

سوپاس بۆ بەڕێزتان

[center]Technology News [/center]

[center]  " TEACHING OTHERS TEACHES YOU "[/center]

7

وه‌ڵام: دروست کردنی بەرنامە بۆ گۆرینی Decimal to hexadecimal,octal,and binary بە ++C

دەست خۆش، بابەتەکان گواسترانەوە بۆ بەشی گونجاو.

8

وه‌ڵام: دروست کردنی بەرنامە بۆ گۆرینی Decimal to hexadecimal,octal,and binary بە ++C

XEYAL نووسی:

دەست خۆش، بابەتەکان گواسترانەوە بۆ بەشی گونجاو.

سوپاس بەرێز

[center]Technology News [/center]

[center]  " TEACHING OTHERS TEACHES YOU "[/center]