Friday, March 28, 2014

Program to understand use of double data type & rounding off

#include<stdio.h>
#include<stdlib.h>
void line()
{
int i,j;
printf("\n");
for(i=1;i<=42;i++)
printf("=");
}
void header()
{
printf("\n");
printf("Built and Designed by Arslan Malik\n\n www.CworldbyAS.blogspot.com");
printf("\n");
}
int main()
{
line();
header();
line();

double a;
printf("%15.1f\n",333.546374);
printf("%15.2f\n",333.546374);
printf("%15.3f\n",333.546374);
printf("%15.4f\n",333.546374);
printf("%15.5f\n",333.546374);


return 0;
}

No comments:

Post a Comment