Pages

Search Script This Blog

Wednesday, June 11, 2014

Program Menentukan Tipe Data C++

#include<iostream.h>
#include<conio.h>
 void main()

{
                clrscr();
                cout<<"Ukuran char        : "<<sizeof(char)<<endl;
                cout<<"Ukuran short       : "<<sizeof(short)<<endl;
                cout<<"Ukuran int         : "<<sizeof(int)<<endl;
                cout<<"Ukuran long        : "<<sizeof(long)<<endl;
                cout<<"Ukuran float       : "<<sizeof(float)<<endl;
                cout<<"Ukuran double      : "<<sizeof(double)<<endl;
                cout<<"Ukuran long double : "<<sizeof(long double)<<endl;
                getch();
}
Outputnya:

 
 
Copyright © scriptprogramer
Blogger Theme by BloggerThemes Design by Diovo.com