Friday, October 1, 2010

#2 Konverzija tipa u C jeziku

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
double a=115055555555.7356;  // broj iz tipa double pretvara se u sve ostale tipove
printf("float a=%f \n",(float)a);
printf("int  a=%d \n",(int)(float)a);
printf("char a=%c \n",(int)(float)a);
printf("octal a=%o \n",(int)(float)a);
printf("unsign a=%u \n",(int)(float)a);
getch();
}

No comments:

Post a Comment