Hi guys, in this section we will discuss some basic Input & Output functions with some examples and format specifiers. So without wasting time let's get started.
We learn enough theoretical concepts of C Programming Language. So let's make a solid coding base by practicing some examples and programs using the previous concepts.
Basic Input & Output Function:
In simple words, input means to provide the program with some data to use in it and output means to display results on the screen by doing some work.
The C Programming Language has a lot of libraries function. The "print()" and "scanf()" functions are used to print/output and take data/input respectively.
So, to include these functions in our C program code we use the header file: " # include <stdio.h>". Here std - standard & io - input and output functionalities.
Beside the print() and scanf() there are some other functions like:
- getchar()
- putchar()
- gets()
- puts() etc.
Example 1:
Write a program code to print "Hello World." on the console/ screen?
Example 2:
Write a program to print basic Input & Output Operations?
In previous examples, we use the symbol "%d" which is known as Format Specifier. In programming languages, we have different types of format specifiers for different data types. Follow the below table for more information.
Note: Please check out our C Programming Example playlist on YouTube for more examples and coding practice through video tutorials.
That's all for this section. For more understanding and explanations watch videos on YouTube.