4 15 Let F G N Positive Integers Define X X G N X Remainder Fx G Divided N Problem Asks Wr Q43781031
please help me with these questions, thank you verymuch!
4. [15] Let f. g, n be positive integers, define x (x g)% n, where x is the remainder of (fx g) divided by n. This problem asks you to write a program to compute x where /, g. and n can be as large as UINT MAX( 2″ – 1) for unsigned interger. Be careful about interger overflow. 5. [15] Use variable-length argument lists (va_list) to write a function node “create_ssl(int N, …) such that a singly linked list of N nodes is created. Assume the node structure is as follows: struct node { struct nodo *next; int data; ); Also show how to call the function. A va list example: void emsg(int code, .) va_list ap: char * Emt; va_start(ap, code); if (code&FILENAME) (void)fprintf(stden, “”%s”:”, va_arg(ap, char “): if (codo&LINENUMBER) (void)fprintf stdorr, “%d:”, va_arg(ap, int): if (code&WARN) (void)fputs( “Warning.”, stderr); fmt – va_arg(ap, char ): (void) vfprimtf stdern, fint, ap): va end(ap); Show transcribed image text 4. [15] Let f. g, n be positive integers, define x (x g)% n, where x is the remainder of (fx g) divided by n. This problem asks you to write a program to compute x where /, g. and n can be as large as UINT MAX( 2″ – 1) for unsigned interger. Be careful about interger overflow. 5. [15] Use variable-length argument lists (va_list) to write a function node “create_ssl(int N, …) such that a singly linked list of N nodes is created. Assume the node structure is as follows: struct node { struct nodo *next; int data; ); Also show how to call the function. A va list example: void emsg(int code, .) va_list ap: char * Emt; va_start(ap, code); if (code&FILENAME) (void)fprintf(stden, “”%s”:”, va_arg(ap, char “): if (codo&LINENUMBER) (void)fprintf stdorr, “%d:”, va_arg(ap, int): if (code&WARN) (void)fputs( “Warning.”, stderr); fmt – va_arg(ap, char ): (void) vfprimtf stdern, fint, ap): va end(ap);
Expert Answer
Answer to 4. [15] Let f. g, n be positive integers, define x (x g)% n, where x is the remainder of (fx g) divided by n. This probl…
OR