Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Type the following program Lab6A.C and run it. #include Hinclude #include int main(void) char name [80]; system(cls); printf(Enter your full name : ); gets

image text in transcribed
3. Type the following program Lab6A.C and run it. #include Hinclude #include int main(void) char name [80]; system("cls"); printf("Enter your full name : "); gets (name); printf(" Your name is ts ", name); system("pause"); return(0); (A) For the above program, what happens if you use scanf to enter the full name? Why? 4. Modify the program Lab6A.C to print your name using a function myPrintf(). Your main function pass the string to function myPrintf(), the function prints your name the same as Lab6A.C does. Save the program as Lab6B.C. 5. Modify the program Lab6A.C to count the number of characters in the name and display both the name and the number of characters. Do not count spaces as characters. The ASCII code for a space is 3210 or as a character. The program must have two separate functions: a character counting function to count the number of characters, and a function to display both the name and the number of characters. Save the program as Lab6C.C. 6. Modify the program Lab6C.C to use the strlen function included in the string.h library rather than your character counting function. Note that the number of characters now includes spaces. Save the program as Lab6D.C

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

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions