Commonly used scanf format codes in C
In C programming language, we use scanf
to take input from users in command line. When taking input, we need to use some flag, that we call ‘format codes’ for scanf
.
Notes with worthy tutorials
Web page: A web page is a single file stored on the server that may contain text, graphics, audio-video and hyperlinks to the other pages on the internet or within a web site. Web pages are written using HTML (Hypertext Markup Language). There are two types of web pages; they are given below. Local web page: A web … Read more
Web browser: Web browser is a software program that is used to navigate through WWW pages stored on the internet. Users use this to request a web page to the server by giving the address and then the browser asks the server and the server returns the page which is then decoded and displayed by the web … Read more
World Wide Web (WWW): The world wide web is a network of computers. When on WWW, a cyberspace traveler can go through information stored in any computer of the world if the information is permitted to be explored on WWW. The information comes to the user in a web page or electronic page which contains hyperlinks. … Read more
In C programming language, we use scanf
to take input from users in command line. When taking input, we need to use some flag, that we call ‘format codes’ for scanf
.
Character Test Functions: In the following table the required functions and their tests are given. Function Test isalnum(c) Is c an alphanumeric character? isalpha(c) Is c an alphabetic character? isdigit(c) Is c a digit? islower(c) Is c a lower case letter? isprint(c) Is c a printable character? ispunct(c) Is c a punctuation mark? isspace(c) Is … Read more
Input & output operations: The operations which took place in order to take data and make the display of the processed information are known as input & output operations. Management of input & output operations: In C language, in general, user use scanf and printf functions for input and output purpose respectively. scanf can be used … Read more
Rules for ++ and – operators: Following are the rules for the increment (++) and decrement (–) operators. Increment (++) and decrement (–) operators are unary operators and they require variable as their operands. When postfix ++ (or –) is used with a variable in an expression, the expression is evaluated first using the original … Read more
Arithmetic operators: The arithmetic operators are +, -, *, /. They work the same way as they do in other languages. There are three types of arithmetic operators which are as follows, . Integer arithmetic: Here operands are integer. For a=14 and b=4, a … Read more
Operator: An operator is a symbol that tells the computer to perform certain mathematical and logical manipulations. Operators are used in programs to manipulate data and variables. Such as, ++, –, <, > etc. Categories of operators: C operators can be classified into a number of categories. They are as follows, Arithmetic operators Logical operators … Read more
Data types: C language is rich in its data types. ANSI supports three classes of data types. Primary or fundamental data types. Derived data types. User-defined data types. All C compilers support five fundamental data types. Namely, integer (int), character (char), floating point (float), double-precision floating point (double) and void. They are described below. Integer types: Integer are whole … Read more