Ex: For 1)January-serial number is 1/001,1/002,1/003 etc.
Sometimes, there is a need to generate the serial number of some format. The given code is doing the same. Here the code generates the serial number in 1/001, 1/002 like format.
public class GenerateSerialNumber { public static void main (String args[]){ int serialNo = 000; for (int i=0;i<12;i++){ serialNo++; System.out.printf("1/%03d\n", serialNo); } } }
Ads