Question: Please use C language to complete this question. Thank you (5marks) Q1: Write a program to extract the first N characters of a string. Your

 Please use C language to complete this question. Thank you (5marks)

Please use C language to complete this question. Thank you

(5marks) Q1: Write a program to extract the first N characters of a string. Your program will have to do the following: Initialize char str[100], substr[100] Apply while loop to traverse to the location till nth position Use of gets and puts SAMPLE TEST OUTPUT: Enter the string:ASSIGNMENT 2 Enter the number of characters to be copis The substring is :ASSIGN fron left: 6 Do not use the same string, This is just Example Process exited after 11.92 seconds with return value @ Press any key to continue Q2: Write a program to add two distances in inch-feet system using structures: (5marks) (For reference: 12 inches is 1 foot) Your program will have to do the following: Use structure name DISTANCE, variables names dist1 and dist2 and store the sum in Result. Add feet to feet and inches to inches Use while loop to deal with inches whose value is more than 12. SAMPLE TEST OUTPUT: Enter 1st distance Enter feet: 8 Enter inch: 10 Enter 2nd distance Enter feet: 2 Enter inch: 7 Do not use the same values. This is just Example Sum of distances 11-5.0" Process exited after 13.91 seconds with return value o Press any key to continue

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!