Question: All your programs must include a Programmers Block and an explainProg function. Format for the Programmers Block: Description: Programmer: Date: Version: Output of all programs
All your programs must include a Programmers Block and an explainProg function.
Format for the Programmers Block: Description:
Programmer:
Date:
Version:
Output of all programs must be included as a comment at the end of your code.
Type the following program and run it. #include
#include
int main(void)
{
char name[80];
printf(Enter your full name : );
gets(name);
printf( Your name is %s , name);
system(pause);
return (0);
}
For the above program, what happens if you use scanf to enter the full name? Why?
Modify the program to print your name using a user - defined function.
Add 2 user - defined function to your program of part 3, 1 to count the number of characters in the name and 2 to display both the name and the number of characters with an appropriate statement. Do not count spaces as characters. The ASCII code for a space is 3210 or as a character.
Add another user-defined function to the program of part 4 to use the strlen function in the string.h library to count the number of characters. Note that the number of characters now includes spaces.
Print out the name and the number of characters, with an appropriate statement.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
