blob: d9b2e9f7234c2bec1c9baaf4dda78ac6dead2eb2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// Exampple 8.4
//Write a program to store the string "United Kingdom" in the array country-
//and display the string under various format specifications.
country='United Kingdom';
printf("\n");
printf("*123456789012345*\n");
printf("--------\n");
printf("%15s\n",country);
printf("%5s\n",country);
printf("%15.6s\n",country);
printf("%-15.6s\n",country);
printf("%15.0s\n",country);
printf("%.3s\n",country);
printf("%s\n",country);
printf("--------\n");
|