Docstoc

Tipe Data (PDF)

Document Sample
Tipe Data (PDF) Powered By Docstoc
					http://ass-lab.blogspot.com
// Tulisan berwarna ungu hanya komentar jadi gak usah ditulis #include<stdio.h> #include<conio.h>

main() { //Penulisan nama variabel jangan pakai spasi mis: bil_bulat char karakter = 'z'; //Tipe karakter pakai kutip 1 char string[20]="Ilham"; //Tipe String pakai kutip2 jumlah karakter=20 int bilbulat = 32000; // Int = Bilangan Bulat maximal = 32767 short bilbulat2 = 400; // bilangan bulat lebih besar dari Int long bilbulat3 = 2000000; // bilangan bulat jangkauan maximal = 2.147.435.647 float pecahan = 34.56; //bilangan pecahan max 5-7 digit double pecahan2 = 14500000.789; //bilangan pecahan max 15-16 digit

printf("\n"); //Memberi garis baru printf("\n Nilai Tipe Char printf("\n Nilai Tipe String printf("\n Nilai Tipe Integer printf("\n Nilai Tipe Unsigned Int = %c",karakter); = %s",string); = %d",bilbulat); = %u",bilbulat);

printf("\n Nilai Tipe Hexadesimal Int = %x",bilbulat); printf("\n Nilai Tipe Octal Int printf("\n Nilai Tipe Short Integer printf("\n Nilai Tipe Long Integer = %o",bilbulat); = %d",bilbulat2); = %ld",bilbulat3);

printf("\n Nilai Tipe Float desimal

= %f",pecahan);

printf("\n Nilai Tipe Float berpangkat = %e",pecahan); printf("\n Nilai Tipe Float gabungan = %g",pecahan); printf("\n Nilai Tipe Double = %lf",pecahan2);

getch();

//Format Printf // %d=Integer %f=Floating Desimal %e=Floating Pangkat %gFloating Desimal&Pangkat // %lf=Double Precision %c=Character %s=String %u=Unsigned Integer // %ld=Long Integer %lu=Long Unsigned integer %x=Hexadesimal Integer %o=Unsigned Octal Integer

}


				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:782
posted:10/11/2009
language:Indonesian
pages:2