Reading

Home / C Programming / Reading

Reading


In C programming, reading input from the user or from a file is commonly done using input functions. There are several input functions available in C that allow you to read different types of data, such as characters, integers, floating-point numbers, and strings. Here are some commonly used functions for reading input in C:


1. `scanf`: The `scanf` function is used to read formatted input from the user or from a file. It takes format specifiers as arguments, which determine the type of data to be read. For example, `%d` is used to read an integer, `%f` for a float, `%c` for a character, and `%s` for a string.