Write a program that prints the value 10.45678 in exponential format with the following specifications:
(a) correct to two decimal places;
(b) correct to four decimal places; and
(c) correct to eight decimal places.
#include <stdio.h>
void main()
{
double a=10.45678;
printf("%.2e\n",a);
printf("%.4e\n",a);
printf("%.8e\n",a);
getch();
}
(a) correct to two decimal places;
(b) correct to four decimal places; and
(c) correct to eight decimal places.
#include <stdio.h>
void main()
{
double a=10.45678;
printf("%.2e\n",a);
printf("%.4e\n",a);
printf("%.8e\n",a);
getch();
}
No comments:
Post a Comment