Rabu, 18 Mei 2011

CARA MENGHITUNG NILAI DESIMAL,OKTAL,HEXADESIMAL DENGAN MENGGUNAKAN C++

#include<stdio.h>
#include<conio.h>
#include<iostream.h>

void main()
{
    int a=3;
   int b=6;
   int c=2;
   int k=5;
   int l=4;
   int m=3;

   clrscr();
       cout<<"Nilai A = "<<a<<endl;
      cout<<"NIlai B = "<<b<<endl;
      cout<<"Nilai C = "<<c<<endl;
      cout<<"Nilai K = "<<k<<endl;
      cout<<"Nilai L = "<<l<<endl;
      cout<<"Nilai M = "<<m<<endl;

    //a= (4+2>a&&b-2>3+2||b+2<=6+2);
   //b= (k+5<m||(c*m<l&&2*k-l>0));
   //c= (l+5<m||c*k<l&&2*k-l>0);
   //k= (a*4<=3*m+b);
   //l= (k+10>a&&l-2>4*c);
   cout<<""<<endl;
   cout<<""<<endl;                
   cout<<""<<endl;
   cout<<"Nilai dari ( 4 + 2 > a && b - 2 > 3 + 2 || b + 2 < = 6 + 2 ) = "<<(4+2>a&&b-2>3+2||b+2<=6+2)<<endl;
    cout<<"Nilai dari ( k + 5 < m || ( c * m < l && 2 * k - l > 0 )     = "<<(k+5<m||(c*m<l&&2*k-l>0))<<endl;
   cout<<"Nilai dari ( l + 5 < m ||  c * k < l && 2 * k - l > 0 )         = "<<(l+5<m||c*k<l&&2*k-l>0)<<endl;
   cout<<"Nilai dari ( a * 4 < = 3 * m + b )                       = "<<(a*4<=3*m+b)<<endl;
   cout<<"Nilai dari ( k + 10 > a && l - 2 > 4 * c )                   = "<<(k+10>a&&l-2>4*c)<<endl;
   getch();}

0 komentar:

Posting Komentar