C scanf() Programs

By IncludeHelp Last updated : March 10, 2024

C - scanf() Function

In C programming language, the scanf() is a standard library function which is defined in stdio.h header file, it is one of the most commonly used functions to take input from the user. The scanf() function is used to read the formatted input from the standard input device (keyboard).

Syntax

scanf("formatted_string", arguments_list);

C scanf() programs/examples

This section contains the C solved programs on scanf() function, practice these programs to learn the concept of standard input in various formats. Each program contains the solved code, output, and explanations.

List of C scanf() Programs

  1. Input integer, float and character values using one scanf() statement in C.
  2. Input an integer value and print with padding by Zeros in C
  3. Input float value and print it with specified digit after decimal point in C
  4. Input an unsigned integer value using scanf() in C
  5. Input a hexadecimal value using scanf() in C
  6. Input octal value using scanf() in C
  7. Input decimal, octal and hexadecimal values in character variables using scanf() in C
  8. Input an integer value in any format (decimal, octal or hexadecimal) using '%i' in C
  9. Input individual characters using scanf() in C
  10. Read a memory address using scanf() and print its value in C
  11. Skip characters while reading integers using scanf() in C



Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.