-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDEVPASS.C
More file actions
27 lines (24 loc) · 808 Bytes
/
Copy pathDEVPASS.C
File metadata and controls
27 lines (24 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "Strings.H"
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
main ()
{
int nSer1, nSer2, nDevPass, a, b, c, d, e, f ;
char szSer1 [10], szSer2 [10], szSer [20] ;
printf ("Micro-Ed developer's password 4-digit number generator\n") ;
printf ("Enter first part of serial-no: ") ;
gets (szSer1) ; nSer1 = atoi (szSer1) ;
printf ("Enter second part of serial-no: ") ;
gets (szSer2) ; nSer2 = atoi (szSer2) ;
sprintf (szSer, "%.2d-%.4d", nSer1, nSer2) ;
a = szSer [0] - '0' ;
b = szSer [1] - '0' ;
c = szSer [3] - '0' ;
d = szSer [4] - '0' ;
e = szSer [5] - '0' ;
f = szSer [6] - '0' ;
printf ("For SN-%d%d-%d%d%d%d developer's password 4-digit number is ", a, b, c, d, e, f) ;
nDevPass = ((((a+1)*(c+1))+((b+1)*(d+1))+((e+1)*(f+1))) * 12) + 12 ;
printf ("%.4d\n", nDevPass) ;
}