Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago