Tuesday, November 24, 2009

History of Visual Basic

Microsoft Visual Basic (often abbreviated as VB only) is a programming language that is event driven and offer Integrated Development Environment (IDE) to create visual-based application program Microsoft Windows operating systems using programming models Common Object Model (COM). Visual Basic is a derivative of BASIC language and the development offers a graphical computer applications quickly, access to databases using Data Access Objects (DAO), Remote Data Objects (RDO), or ActiveX Data Objects (ADO), and offers an ActiveX control creation and object ActiveX. Some scripting languages such as Visual Basic for Applications (VBA) and Visual Basic Scripting Edition (VBScript), similar as Visual Basic, but the way it works differently.

The programmer can build applications using components provided by Microsoft Visual Basic programs written in Visual Basic can also use the Windows API, but requires an additional external function declarations.

In business programming, Visual Basic has a market share of very large. In a survey conducted in 2005, 62% reported software developers use various forms of Visual Basic, which was followed by C + +, JavaScript, C #, and Java.


History

Bill Gates, founder of Microsoft, started the business by developing software Basic language interpreter for the Altair 8800, for then he changed to run on the IBM PC with DOS operating system. The next development is the launch of BASICA (basic-advanced) for DOS. After BASICA, Microsoft launched the Microsoft QuickBASIC, and Microsoft Basic (also known as Basic Compiler).

History in the hands of Microsoft BASIC as the language that is interpreted (BASICA) and also a compiled language (Bascom) to Visual Basic is implemented as a combination of both.

Programmers who use Visual Basic can choose the compiled code or code should be interpreted as a result of the executable from VB code. Unfortunately, despite already compiled a machine language, DLL named MSVBVMxx.DLL still needed. But the characteristics of the compiled language still appear (it is faster than if we use terinterpretasi mode).
READ MORE - History of Visual Basic

Visual Basic is a programming language based graphical windows the function can also be used in calculating a person's date of birth, just by entering 2 paramter to be processed and Brontok Virus Made in VB

Visual Basic is a programming language based graphical windows (GUI-Graphical User Interface). The nature of language pemprogramannya is eventdriven, means the program will occur if there is a response from the user form event / specific event (the button is clicked, the mouse is pressed, etc.). When event occurs then the code associated with the event will run. In Visual Basic, making application start by estimating needs, designing the look and then followed by the code generation for the program. This section will explain about the introduction of Visual Basic programs in making Windows applications. Running the Visual Basic program with the program other windows, ie by double clicking the icon that is used to run the program. Here is the first time display the Visual Basic run.The following functions are used to calculate the time / date in more detail. Where the following functions to display Day of Month and Year of the process.The function can also be used in calculating a person's date of birth, just by entering 2 paramter to be processed.

code:
Function cari_umur(TanggalAwal As Date, TanggalAkhir As Date) As String
On Error GoTo salah
Dim tahun As Long, bln As Integer, bulan As Integer, thn As Long
Dim Counter As Integer, hari As Integer

hari = Format(CDate(TanggalAwal), "d")
bln = Format(CDate(TanggalAwal), "m")
thn = Format(CDate(TanggalAwal), "yyyy")

Do Until (hari = Format(CDate(TanggalAkhir), "d") And _
bln = Format(CDate(TanggalAkhir), "mm") And _
thn = Format(CDate(TanggalAkhir), "yyyy"))
hari = hari + 1


If hari = Format(CDate(TanggalAwal), "d") Then
bulan = bulan + 1 'jumlah bulan
Counter = 0 'jumlah hari
If bulan = 12 Then
bulan = 0
tahun = tahun + 1 'jumlah tahun
End If
Else
Counter = Counter + 1
End If

If CDate(hari & "/" & bln & "/" & thn) = CDate(Trim(TanggalAkhir)) Then Exit Do
If bln = 1 And hari = 31 Then
bln = bln + 1: hari = 0
ElseIf bln = 2 And hari = 29 And thn Mod 4 = 0 Then
bln = bln + 1: hari = 0
ElseIf bln = 2 And hari = 28 And thn Mod 4 > 0 Then
bln = bln + 1: hari = 0
ElseIf bln = 3 And hari = 30 Then
bln = bln + 1: hari = 0
ElseIf bln = 4 And hari = 30 Then
bln = bln + 1: hari = 0
ElseIf bln = 5 And hari = 31 Then
bln = bln + 1: hari = 0
ElseIf bln = 6 And hari = 30 Then
bln = bln + 1: hari = 0
ElseIf bln = 7 And hari = 31 Then
bln = bln + 1: hari = 0
ElseIf bln = 8 And hari = 31 Then
bln = bln + 1: hari = 0
ElseIf bln = 9 And hari = 30 Then
bln = bln + 1: hari = 0
ElseIf bln = 10 And hari = 31 Then
bln = bln + 1: hari = 0
ElseIf bln = 11 And hari = 30 Then
bln = bln + 1: hari = 0
ElseIf bln = 12 And hari = 31 Then
bln = 1: thn = thn + 1: hari = 0
End If
Loop

cari_umur = Counter & " hari " & bulan & " bulan " & tahun & " tahun"
Exit Function
salah:
If Err.Number = 13 Then
MsgBox "format tanggal salah"
End If
End Function

Private Sub Command3_Click()
'Mulai tanggal - s/d tanggal
MsgBox cari_umur(CDate(Text1), CDate(Text2))
End Sub




Brontok Virus Made in VB
This time the author will try to discuss a little about the virus eagle made by local programmer in visual basic compile by 6.0 ....

Code: Select all

In the past this time you may have heard the name of the virus Brontok virus ?...... yes that's right menduplikatkan himself and adjust the name of the new viruses based on folders or files on the active window epxlorer. The characteristics of this virus is to use the folder icon, so as to deceive a person who saw it.


Form -> BrontokForm
Module -> API

Dengan detail berikut:

Begin VB.Form BrontokForm
Caption = "Brontok.A"
ForeColor = &H8000000F&
ScaleMode = 1
BeginProperty Font
Name = ""
Size = 195323.4944
Charset = 29
Weight = 774
EndProperty

Begin VB.Timer TmrBrontok
Enabled = 0 'False
Interval = 2000
Left = 2160
Top = 0
Width = 57352
Height = 1
End
End


Dengan nama Project: Brontok.vbp, yang disimpan pada directory:
F:\VPROJECT\REHAB\Re-1\BRONTOK.A

Jelas sekali bahwa virus ini dibuat oleh sorang program lokal, yang mempunyai skill Menengah Keatas.

Ada beberapa procedure & function yang digunakan dengan nama:

Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
TmrBrontok_Timer()
Subr_004()
CekKoneksiInternet()
ManipulasiExec()
Subr_007()
KeluarDong()
BronReg()
CopyAppData()
DownloadVir()
StartDong()
StartUp()
DecTeks()
MutMutex()
MutCr()
DownloadFile()
CekUpdate()
InfekNetwork()
Judul()
CekRemDisk()
BikinFile()
GetEmailFile()
CekValidMail()
GetTeks()
CekKar()
ListMail()
GetTargetMBhs()
GavMailer()
BrontokMail()
Subr_031()
DataEmail()
DownMIME()
FindFilesAPI()
ListFileGav()
InfekFile()
SmallAttack()
MinggirLoe()
GetHostByNameAlias()
StripNulls()
BikinKredit()

Dan beberapa fungsi Api yang digunakan anatara lain:

Fungsi Baca Tulis Ke Register:
Declare Function RegOpenKeyExA Lib "advapi32.dll" ()
Declare Function RegSetValueExA Lib "advapi32.dll" ()
Declare Function RegCloseKey Lib "advapi32.dll" ()
Declare Function RegCreateKeyExA Lib "advapi32.dll" ()

Declare Function Sleep Lib "kernel32" ()

Mendapatkan Spesial Folder:
Declare Function SHGetPathFromIDList Lib "shell32.dll" ()
Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" ()

Membaca Isi Halaman Situs:
Declare Function InternetOpenA Lib "wininet.dll" ()
Declare Function InternetOpenUrlA Lib "wininet.dll" ()
Declare Function InternetReadFile Lib "wininet.dll" ()
Declare Function InternetCloseHandle Lib "wininet.dll" ()

Mendapatkan Caption Dari Sebuah Window:
Declare Function GetWindowTextA Lib "user32" ()
Declare Function GetWindowTextLengthA Lib "user32" ()

Dapatkan HWND Window aktif:
Declare Function GetForegroundWindow Lib "user32" ()

Shutdown, Reboot, LogOff Windows:
Declare Function ExitWindowsEx Lib "user32" ()
Declare Function GetCurrentProcess Lib "kernel32" ()
Declare Function OpenProcessToken Lib "advapi32" ()
Declare Function LookupPrivilegeValueA Lib "advapi32" ()
Declare Function AdjustTokenPrivileges Lib "advapi32" ()

Mendapatkan Jenis Media yang ada spt Removable Disk, CD-Rom dll:
Declare Function GetDriveTypeA Lib "kernel32" ()

Declare Function ShellExecuteA Lib "shell32.dll" ()
Declare Function RtlMoveMemory Lib "kernel32" ()

Winsock API:
Declare Function closesocket Lib "wsock32.dll" ()
Declare Function connect Lib "wsock32.dll" ()
Declare Function htons Lib "wsock32.dll" ()
Declare Function inet_addr Lib "wsock32.dll" ()
Declare Function recv Lib "wsock32.dll" ()
Declare Function send Lib "wsock32.dll" ()
Declare Function socket Lib "wsock32.dll" ()
Declare Function gethostbyname Lib "wsock32.dll" ()
Declare Function WSAStartup Lib "wsock32.dll" ()
Declare Function WSACleanup Lib "wsock32.dll" ()
Declare Function WSAAsyncSelect Lib "wsock32.dll" ()

Fungsi yang berhubungan dengan file:
Declare Function FindFirstFileA Lib "kernel32" ()
Declare Function FindNextFileA Lib "kernel32" ()
Declare Function GetFileAttributesA Lib "kernel32" ()
Declare Function FindClose Lib "kernel32" ()
dll...

Terlihat jelas pada fungsi-fungsi api yang digunakan bahwa penularan virus ini brontok menggunakan beberapa cara. seperti pengiriman lewat email, pencarian nama komputer yang terhubung kejaringan dengan menyalin dirinya pada folder yang di sharing dan menyalin dirinya pada window explorer yang aktif. kalo gak salah si pembuat virus mempunyai SMTP sendiri (wah ati-ati mas ntar ketangkep)

Jika dilihat kembali pada strukturnya ada beberapa kata yang di encrypt, kemungkinan berupa exploit code atau apalah namanya. hanya allah dan pembuat virus yang tau. @!img1@

Virus ini mempunyai fungsi ExitWindowsEx yang diimport dari file user32.dll, fungsi ini biasanya digunakan untuk mematikan windows.
kayaknya sipembuat virus membuat triger yang berisi perintah mematikan/merestart komputer.

Selain itu dalam struktur filenya terdapat kata-kata seperti ini:
FOLDER.HTT
RORO
.HTT
.DOC
.CSV
.EML
.CFM
.PHP
.WAB
.EML
.TXT
.HTML
.HTM
MY DATA SOURCES
MY EBOOKS
MY MUSIC
MY SHAPES
MY VIDEOS
MY DOCUMENT

Dan ada beberapa alamat situs yang diserang, apa DDOS ya...hik..hik..tau deh. Selain itu pembuat virus mencantumkan nama: --JowoBot#VM Community --

Selanjutnya coba lihat tiga fungsi api berikut:

Declare Function GetWindowTextA Lib "user32" ()
Declare Function GetWindowTextLengthA Lib "user32" ()
Declare Function GetForegroundWindow Lib "user32" ()

Sepertinya pembuat virus memanfaatkan windowexplorer untuk memperbanyak filenya ke folder yang lain. Dengan cara membaca Caption yang terdapat pada windows aktif yang berisi nama directory/path. Dengan menggunakan 2 fungsi diatas (GetWindowTextA & GetWindowTextLengthA), Sedangkan fungsi GetForegroundWindow digunakan untuk mendapatkan Handle Window (HWND) yang sedang aktif.

Jadi kesimpulannya virus ini tidak dapat menyalin dirinya kalo Caption pada windowExplorer bukan berupa Directory/Path. Sehinga si pembuat virus menonaktifkan setting pada Folder Options.

Kemudian yang lebih unik lagi virus ini membaca isi halaman situs yang terbuka pada sebuah InternetExplorer dengan menggunakan fungsi:

Declare Function InternetOpenA Lib "wininet.dll" ()
Declare Function InternetOpenUrlA Lib "wininet.dll" ()
Declare Function InternetReadFile Lib "wininet.dll" ()
Declare Function InternetCloseHandle Lib "wininet.dll" ()
READ MORE - Visual Basic is a programming language based graphical windows the function can also be used in calculating a person's date of birth, just by entering 2 paramter to be processed and Brontok Virus Made in VB

Monday, November 23, 2009

string karakter

final public class String
extends Object
mengimplementasikan Serializable, Sebanding, CharSequence

Mewakili kelas String string karakter. Semua string literal dalam program Java, seperti "abc", yang diimplementasikan sebagai contoh kelas ini.

String konstan; nilai-nilai mereka tidak dapat diubah setelah mereka diciptakan. Dukungan buffer string bisa berubah string. Karena objek String berubah mereka bisa dibagi. Contoh:

         
String str = "abc";
     

adalah setara dengan:

         
char data [] = ( 'a', 'b', 'c');
         
String str = new String (data);
     

Berikut ini adalah beberapa contoh bagaimana string dapat digunakan:

         
System.out.println ( "abc");
         
String CDE = "CDE";
         
System.out.println ( "abc" + CDE);
         
String c = "abc". Substring (2,3);
         
String d = cde.substring (1, 2);
     
String kelas meliputi metode untuk memeriksa karakter individu dari urutan, untuk membandingkan string, untuk mencari string, untuk mengeluarkan substrings, dan untuk membuat salinan dari sebuah string dengan semua karakter diterjemahkan ke huruf besar atau huruf kecil. Kasus pemetaan sangat bergantung pada informasi yang disediakan oleh Unicode Unicode Consortium 3,0 spesifikasi. Spesifikasi's SpecialCasing.txt file UnicodeData.txt dan digunakan secara ekstensif untuk menyediakan pemetaan kasus.

Bahasa Jawa memberikan dukungan khusus untuk operator concatenation string (+), dan untuk konversi objek lain mengerjakan sesuatu. Rangkaian string dilaksanakan melalui StringBuffer append kelas dan metode. Konversi string diimplementasikan melalui metode toString, ditetapkan oleh Objek dan diwarisi oleh semua kelas di Jawa. Untuk informasi tambahan pada tali Rangkaian dan konversi, lihat Gosling, Joy, dan Steele, The Java Language Specification.

Kecuali dinyatakan lain, melewati null argumen untuk sebuah konstruktor atau metode dalam kelas ini akan menyebabkan NullPointerException untuk dilempar.


Java is development tool artinya dengan java kita bisa membuat software secara fleksibel dan powerful. Keunggulannya independence platform maksud source code yang kita tulis tidak tergantung pada sistem operasi. Berarti slogan WORA (write one run anywhere) cukup pantas disandang oleh java.

Maka Java dalam setiap setiap Platform harus terinstalasi 3 komponen utama :

         1. Bahasa pemrograman
         2. Class pustaka dan interface java
         3. JVM (Java Virtual Machine)

Dalam perkembangan hingga kini Java mencapai versi 2 yang dikenal dengan Java 2 Platform, dibagi menjadi 3 katagori :

1 . J2SE (Java 2 Standard Edition)
2. J2EE (Java 2 Enterprise Edition)
3. J2ME (Java 2 Micro Editon)





Membaca dari dan Menulis ke Socket dengan java
import java.io.*;
import java.net.*;

public class EchoClient {

public static void main(String[] args) throws IOException {

Socket echoSocket = null;
PrintWriter out = null;
BufferedReader in = null; try {
echoSocket = new Socket("taranis", 7);
out = new PrintWriter(echoSocket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader( echoSocket.getInputStream()));

} catch (UnknownHostException e) {

System.err.println("Don't know about host: taranis.");
System.exit(1); } catch (IOException e) {
System.err.println("Couldn't get I/O for " + "the connection to: taranis.");

System.exit(1);
}
BufferedReader stdIn = new BufferedReader( new InputStreamReader(System.in));
String userInput; while ((userInput = stdIn.readLine()) != null) {
out.println(userInput);

System.out.println("echo: " + in.readLine());
} out.close();
in.close();
stdIn.close();
echoSocket.close();
}
}
READ MORE - string karakter

Wednesday, November 18, 2009

Fungcion C++

Fungcion C++
  • # include . The sentence that begins with the sign (#) is a directive to preprosesor. Not a line of code is executed, but the indications for the compiler. In this case the phrase # include notify preprosesor header compiler to include the iostream standard file. This specific file also includes declarations standard library I / O in C + + and this file is included because its functions will be used later in the program. The function used is the court stands for the console out or display data to the console or screen.
  • # include
    Because using getch, it is necessary declaration header file that stores declaration conio getch function.
  • int main ()
    This line matches at the beginning of the declaration of main functions. main function is the starting point where all the C + + program will begin execution. Placed at the beginning, middle or end of the program, the contents of the main functions will always be executed first. Basically, the entire C + + programs have a main function. play followed by a pair of parentheses () as a function. in C + +, all functions followed by a pair of parentheses () where, can contain arguments therein. The contents of the
    main function will then be followed, a formal and written declaration of ({}), brace as in the example.
  • court << "Hello World";
    This instruction is the most important thing in the program examples. court is the standard output stream in C + + (usually the monitor). court declared in the header file iostream.h, so in order to use the file must be included. Consider every sentence ends with a semicolon (;). This character marks the end of the instruction and must be included at the end of each instruction in C + + programs of any.
  • getch ();
    The function getch () function is to receive from the user entered via the keyboard, but in this program, getch only serves to stop the process before the results window disappears. If the getch command does not exist, then the results window will appear briefly and then quickly disappeared, so the last command executed.
     
  • return 0;
    Return instruction causes the function main () ends and returns the code that follows these instructions, in this case 0. This is the most often used to terminate the program. Not all lines in this program take action. There are lines containing only comments (preceded / /), a line that contains instructions to the compiler preprocessor (the beginning #), then the row is the initialization of a function (in this case, the main function) and the rows that contain instructions (eg, court < <), the last line is included in the block bounded by curly braces (()) of the main functions
     
  • Comments
    In row 1, found in alert / * and on line 4 in the sign * /. Both these signs are useful in pairs to write a comment about the program or the commands. Comments do not affect the program because the comments did not run as command (statement). Comments by using signs / * apply to find a * /. Another way to provide comments is to provide a slash 2 times. Comments by this sign only applies to the 1 line. Comments are optional to facilitate the people to know the function of a program or an algorithm
     
  • # include
    At 6 in the command line # include "stdio.h" and on line 7 is the command # include . Both commands are used to call the header file (include file) in which there command, function or prototype that can be used in programs created. If the command # include is not written, then the computer does not understand the orders written.
  •  Header files
    The file name used in # include as conio.h and stdio.h, called the header files because placed at the top of the program. Extention H means header. In this header file, there is a function or a prototype that can be used in the program. A header file has more than 1 function or variable stdio.h header global.File used for handling input / output standards such as writing to the screen, to files or reading data from the keyboard or a file.
    Stdio.h header file is used to handling the screen as color settings, the time gap (delay), voice internal.
    Stillmany other standard header files stdio.h and conio.h.
  •  Function main ()
    In line 8 there is declaring the function main (). This function is a special function to be executed first. Each program must have a function main (). Function main () begins with a sign stating (beginning of the program and ends with a) is declared the end of the program.
  • printf ()
    printf () is a function that allows you to write messages to the screen. Messages to be written in the enclosed by quotation marks. Written messages can be adjusted by adjusting the format of the writing. The function printf () not just write a message in just 1 line but can be more. To move the line then use the command \ n which means the new line (new line). Writing \ n may be placed in the front, middle or end. To write the sign "(quotes) then must use the \". Further information will be explained in subsequent chapters.
  • Signs; (semikolon)
    Each command must end with a sign;. Loss of signal; will cause compilation errors.
  • getch ()
    getch () is a function that works for reading data from a character, so the program will pause until the user pressed a button. This function is in the header files so conio.h command # include "conio.h" should be written. If the command getch () is not written, then the program will be done quickly and execution can not be seen.
  • return
    return is the command that gives value to the function. Every function must have the change the value (return value).
       
READ MORE - Fungcion C++

Calling Program Turbo C

Calling Program Turbo C

Language C or C + + is a programming language. Language C includes the middle-level programming language, meaning language C can be studied more easily because it is easy to understand but has a high capacity. Language C can be used to engineer the program to all needs, whether for business applications, mathematical or even games. All languages have a weakness or their own excess. Likewise with the language C. As part of the excess of the C language is as follows:

  • Many have an operator to process / manipulate the data.
  • Language C includes a structured language, so the program can be more easily understood or developed.
  • Language C is more easily understood because it is more similar to human language.
  • High execution speed.
  • Pointer data to know the weaknesses of the language C is:
  • The number of operators or in writing programs sometimes cause confusion the user.
  • The need for accuracy in the writing program because of the command (statement) in C are case sensitive (uppercase and lowercase distinguished. Lack -deficiency will be a lot happening in the beginning to learn the language C, but when used to make the program or learn a little difficulty will decrease gradually
To enter into the environment Turbo C + +, there are several ways that can be done, the following methods developed with the assumption that users are using the operating system window.1.Fasilitas
Run
 
from the start menu

  • Click the Startthen select Menu Run
  • Click the Browse then locate the folder in which there TC.EXE files. Usually located at C: \ TC \ BIN or C: \ TC or C: \ TURBOC3, and then click TC.EXE.
  • Press the OK button, wait until the program appears C + + .2. MS-DOS Prompt
  • Click the Start then menu Programs select
MS-DOS Prompt.

  • Type the command CD \ TC \ BIN if the C + + programs are stored in the sub directory C: \ TC \ BIN and then press the Enter key.
  • Type TC.EXE or TC, then press Enter, wait until the program appears C + + .3. Short Cut
  • Click the right mouse button on the desktop and then select sub menu New on the popup menu and then Select
Short Cut.

  • Click the Browse then locate the file TC.EXE in subdierktori C: \ TC \ BIN or C: \ TC. Then click the button Next
  • Write cutnya short name, then click the button Next 
  • Choose a short cut icon and press the Finish
  • To run it, double-click the short cut that has been made.
Basic concepts of program structure C + + can be viewed as a collection of one or several functions. The first function that must exist in the C + + programs already in the specified name, which is called main (). A function in C + + program opened with the open brace '(' and ends with a closing brace ')'. Among these curly braces can be written statements C + + programs. Whereas in the beginning of the program needs to input header files. The shape of the header file is # include Examples of program structure C + +:



READ MORE - Calling Program Turbo C

Tuesday, November 17, 2009

Denominator data type


 
Denominator data type
Variable Types of Numbers
Before we can use certain variables in the program C #, we must give known to the compiler about the type of variable itself. Seen from the examples above, we see that all variables are contained numbers. However, the computer not only process the numbers only, however, other than the variable rate is also capable of storing many types of data. In fact, for this type of numbers, C # supports three types:


  • When we're writing a program, which requires that there numbers should not be divided (integer), as well as the student population at the school, or others, C # offers us what is referred to as "integer." It is impossible that only students living there are his alone, or hand it?
  • When we're writing a program to deal with financial problems (which often used in the industry), we must use the numbers with the number of digits long, may reach the trillions. Language C # offers tell us what is called a "decimal."
  • When we're writing a program used to count things scientific, such as the formula of relativity and quantum physics, maybe we need there is a commanumbers and rank represented in the form of notation Scientific (mantissa and Exponent). In C #, such numbers are called also to floating point number, which is represented by using the keyword "float." 
READ MORE - Denominator data type

Integer data type


Integer data type

The types of data in the table is specific to the data value rounded numbers. How to declaring the data type is the same as any other declaring, namely:
int a; 

unsigned int b; 
char c; 
long d;

In the C programming language

Integer type used in standard C language is the type int. The size and scope of type int data often depends on the compiler and computer used, but usually equivalent to a short int or long int.

Besides int type, there are several other data types that can hold integers, including:

  • Char. In fact this data type is used to store characters in ASCII code, but can also be used to store an integer from 0 to 255
  • Short int, 2 byte size, range -32.768 to 32.767
  • Long int, size 4 bytes, range -2,147,483,648 to 2,147,483,647
Data types can store on the negative and positive integers. To save a positive number and zero, you can use the keyword unsigned before the type of data. For example:

  • Unsigned short int, 2 byte size, range from 0 to 65.535
  • Unsigned long int, size 4 bytes, range 0 to 4,294,967,295
In the Pascal programming language
In Pascal, integers can accommodate 16-bit Despite its size 2 bytes (16 bits) but because an integer is a signed data type is only capable of in-assign values between -215 to 215-1 of -32,768 to 32767. This is because 1 bit is used as a marker of positive / negative. Despite having the same terms, but an integer data type in Visual Basic.NET programming language and Borland Delphi has size 4 bytes or 32 bits signed so that it can be assign a value between -2,147,483,648 to 2,147,483,647.

In addition to integer type, the Pascal language has several different types:

  • Bytes, the size of 1 byte, range from 0 to 255
  • Smallint, size 1 byte, range from -128 to 127
  • Word, the size of 2 bytes, range from 0 to 65.535
In Pascal compiler newer, also known types of data more like:

  • Longint, size 4 bytes, range from -2,147,483,648 to 2,147,483,647
  • Cardinal, size 4 bytes, range from 0 to 4,294,967,295
In the C # programming language
In the programming language C #, there are several variations of the integer data types, namely:

  • Byte: unmarked integers (unsigned integer) 8-bit. Equivalent System.Byte data type in Microsoft. NET Framework.
  • Sbyte: marked integers (signed integer) 8-bit. Equivalent data type in Microsoft System.Sbyte. NET Framework.
  • Short: integer 16-bit marked. Equivalent to System.Int16 data type in Microsoft. NET Framework.
  • Ushort: unmarked integers (unsigned integer) 16-bit. Equivalent data type in Microsoft System.UInt16. NET Framework.
  • Int: integer marked (signed integer) 32-bit. Equivalent to System.Int32 data type in Microsoft. NET Framework.
  • Uint: unmarked integers (unsigned integer) 32-bit. Equivalent data type in Microsoft System.UInt32. NET Framework.
  • Long: marked integers (signed integer) 64-bit. Equivalent to System.Int64 data type in Microsoft. NET Framework.
  • Ulong: unmarked integers (unsigned integer) 64-bit. Equivalent data type in Microsoft System.UInt64. NET Framework.
READ MORE - Integer data type

Character data type


Character data types can be displayed as a character or as a number. This depends on how the writing is regarded as a character or a number. To write the contents of the data type char is to use printf with the format of writing using sign% c if you want to appear as a character or the% i if you want to appear as a number.
This data type has a range from 0 to 255, or ASCII characters to ASCII characters 0 to 255.  
char karakter;
char kar1,kar2,kar3;
char kar4=’A’;
char kar5=65;
Giving value to a character use the following command:
karakter=’A’;
Atau
karakter=65; 



The second way to produce a similar effect is to give the value of a 65 or a character to character variables. If you want to use a variable charge character of the character will be sandwiched between the input apostrophe. To see the value in a variable of type char using the following command 
printf(“Karakter dilihat dalam bentuk karakter = %c.\n”,karakter);
printf(“Karakter dilihat dalam bentuk angka = %d.\n”,karakter); 

 Command "
char k1, k2;
"In line 6 means 2 programs booked a place in memory to store data of type character with the name of k1 and k2.Perintah"
k1 = 'A';
"On line 7 is the command to insert a character value into variable capital k1 so for the next line contains the characters A k1 capital or number 65.Perintah"
k2 = k1;
"In line 8 means that the value of k2 is filled so that the contents of k1 values equal to k2 variable content in k1.Perintah printf at line 9 is the command to display the writing in accordance with the format" variable value k1 is% c \ n ". Character% c was not printed as% c, but will be replaced by variables in accordance with the order of k1 in the form of characters. Printf command on line 10 works the same way with the printf command in line 9 the difference is only signal% d from written based on
k2 variable content printed in the form of numbers rather than characters. Sign% d format is used for printing the data in the form of numbers bulat.Perintah
getch ()
 
used to wait until the user pressing any karaker.Perintah
return
 
used to change the value of the function main ().
READ MORE - Character data type

Sunday, November 15, 2009

selection of branching in c + +

selection of branching in c + +
in c + +, 2 fruit selection known branching, by using if and case.



READ MORE - selection of branching in c + +

Looking for the Biggest & Smallest number in C + +

Looking for the Biggest & Smallest number in C + +
Here is a C + + source code for finding the largest number from n inputs that you made. Principally only compare that number with the previous number. To find smallest number, simply change the sign> to <



READ MORE - Looking for the Biggest & Smallest number in C + +

Divide the money in various denominations

Divide the money in various denominations
Such as we have as much money as 140,000, then logically if the money is sorted based on great currency in circulation it will consist of: :
  • 1 sheet of money 100 thousand
  • 2 pieces of money of 20 thousand





READ MORE - Divide the money in various denominations

Tipe Data Struct



The above example shows that the struct be named "box" with the data field length, width and area.
Benefits struct data type is basically to save the package (set) data into one variable name. Collection of data is collected into one and can have a data type variety. When naming struct, get used to form a unity of meaning with is struct, for example if it struct named struct box then its contents are: length, width, and area. 
To accommodate some of the data, struct is usually combined with the Array, for example inisialisasi as follows:
struct mahasiswa {
int nim;
char nama[20];
float IPK;
} data[5];

Example initialization struct is named "student" with nim data fields, name and GPA. While the variable name is made of the data array of size 5. It means we will create an array to accommodate as many students struct data 5. The concept is usually coupled with a logic array for data storage is not possible only a single data store, but certainly more than one data, for example as follows:

initialization struct called "students" with nim data entries, the name and GPA. While the variable name is made of the data array of size 5.
 




 
 
 
 
READ MORE - Tipe Data Struct

calculation

calculation
Calculator Mode, terminals that have the ability count as a calculator. Users enter an expression and the computer will evaluate and provide an answer as soon as possible.



READ MORE - calculation

Programs with variable string



Type the characters / string Tipe these data presented in the form of characters. This data type is expressed with the type char, While for the string (character set) is expressed as a pointer of type char, that is written with char *. In C + +, the type of characters enclosed in single quotes ( 'A'), while the type of string enclosed in double quotes ( "AGUS"). Data types fall into this category are as tecantum in the table below.


READ MORE - Programs with variable string
 
THANK YOU FOR VISITING