A U.S. social security number consists of a string of 9 digits, such as "444422333". Assume that input consists of a sequence of 9-digit social security numbers with no intervening spaces or separators of any kind:111223333444422333123456789987654321...Assume that a char array named ssn suitable for storing a social security number as a C-string has been declared . Use this array to read in 3 successive social security numbers and print each one out on a line by itself

Respuesta :

Answer:

767745089

Explanation:

Answer:

void printSecurityNumber(char * securityNumber){

char subs[9];

int i = 0;

while(i < 27){

subs[i%9] = securityNumber[i];

i++;

if(i == 8){

printf("%s\n", subs);

}

}

}

Explanation:

I am going to write a for loop for this.

The "break" is at a multiple at position 8(9 digit from position 0 to 8), 17(9 digits from position 0 to 17), 26(9 digits from position 18 to 26).

void printSecurityNumber(char * securityNumber){

char subs[9];

int i = 0;

while(i < 27){

subs[i%9] = securityNumber[i];

i++;

if(i == 8){

printf("%s\n", subs);

}

}

}

ACCESS MORE
EDU ACCESS
Universidad de Mexico