Monday, 8 December 2014

Example program to view the difference between implicit & Explicit declarations
#include<stdio.h>
#include<stdlib.h>
main()
{
float a=100,b=20;
int c,c1;
float c2,c3;
c=a;
c1=b;
c2=a;
c3=b;
printf("%f\t%f\t%f\t%f\n",(float)c,(float)c1,c2,c3);
}
OutPut:
madan@madan-Lenovo-G570:~/madan$ cc ex38.c
ex38.c: In function �main�:
ex38.c:11:1: warning: incompatible implicit declaration of built-in function �printf� [enabled by default]
 printf("%f\t%f\t%f\t%f\n",(float)c,(float)c1,c2,c3);
 ^
madan@madan-Lenovo-G570:~/madan$ ./a.out
100.000000 20.000000 100.000000 20.000000