Question: Write a function that takes a character array a[] and prints it after changing it in the following manner: in C program If the summation

 Write a function that takes a character array a[] and prints

Write a function that takes a character array a[] and prints it after changing it in the following manner: in C program If the summation of the last 3 digits of your id is even, every even index character should be replaced with 3 digits of your id. Else if the summation of the last 3 digits of your id is odd every odd index character should be replaced with 4 digits of your id. Example: if id is 011182039, Summation of last 3 digits = 0 + 3 + 9 = 12 which is even Input Output Function 039u039c039i039n Good 0390039d Bad 039a039 = If your id is 011182038, = 0 + 3 + 8 = 11 which is = Summation of last 3 digits odd. Input Function Good Bad Output F2038n2038t023802038 G203802038 B2038d

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!