Welcome Guest | Sign in | Register
printf() and scanf() - Discussion Page For Q.10537 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > printf() and scanf() > Questions and Answers

Q: The statement to read a single character from the keyboard into the variable operator, skipping leading blanks, tabs and newline characters, is
A. scanf("%s", operator); B. scanf("%c", &operator);
C. scanf(" %c", &operator); D. scanf(" %c", operator);

Answer and Explanation

Answer:scanf(" %c", &operator);

Explanation:
The leading space before the modifier %c informs scanf() to skip leading whitespace characters.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.