blob: c6fdebbcb242207b284cf8197301f9c1ca279f67 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// Example 4.10
// The program illustrates all the options of printing a real number.
y=98.7654; //real number
//Various options of printing a real number
printf('%7.4f\n',y);
printf('%f\n',y);
printf('%7.2f\n',y);
printf('%-7.2f\n',y);
printf('%07.2f\n',y);
printf('%7.2f\n',y);
printf('\n');
printf('%10.2e\n',y);
printf('%12.4e\n',-y);
printf('%-10.2e\n',y);
printf('%e\n',y);
|