Write the query (including a printf prompt and a scanf) to get a user to enter a lowercase letter. Continue to loop (and prompt the user) until they have successfully entered an appropriate character. Do not forget to declare the variable that you are using to store the character. Do not forget to use the ampersand (&) in the scanf. Do not write an entire program.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write the query (including a printf prompt and a scanf) to get a user to enter a lowercase letter.
Continue to loop (and prompt the user) until they have successfully entered an appropriate character.
Do not forget to declare the variable that you are using to store the character.
Do not forget to use the ampersand (&) in the scanf.
Do not write an entire program.
I U
A
I E
12pt
Paragraph
fr
9:01 AM
hulu
100%
12/12 202
Transcribed Image Text:Write the query (including a printf prompt and a scanf) to get a user to enter a lowercase letter. Continue to loop (and prompt the user) until they have successfully entered an appropriate character. Do not forget to declare the variable that you are using to store the character. Do not forget to use the ampersand (&) in the scanf. Do not write an entire program. I U A I E 12pt Paragraph fr 9:01 AM hulu 100% 12/12 202
Expert Solution
Introduction

printf and scanf functions: The C library header file, stdio.h contains the two predefined functions. The printf function display on the standard output display device. The scanf function to read the data from the standard input device, keyboard.

The format of scanf takes the format specifier and variable name with an ampersand(&). The format of printf takes the format specifier and variable name.

 

Step 2

Declarations of C statements to define the character,and read the lower case letter .The loop continues until user enters a character other than lower case letter.

//declare variable,ch
 char ch;
 //prompt for user input
 printf("Enter a lower case letter : ");
 //read a character
 scanf("%c",&ch);
 //Loop continue till user enters a lower case letter
 while(ch>='a' && ch<='z')
 {
  //prompt for user input
  printf("You entered: %c\n", ch);
  printf("Enter a lower case letter : ");
  //clear the buffer area
  fflush(stdin);
  //read a character
  scanf("%c",&ch);
 }

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY