C Input & Output
In C language, printf() and scanf() functions are used as input and output inbuilt library functions. It defined in stdio.h (header file).
- printf()
- scanf()

printf() function
The printf() function is used to display the output. It displays the statement to the console.
Syntax of printf() function
printf("string format",argument);
String Format
- %d - integer
- %c - character
- %s - string
- %f - float and etc.
scanf() function
The scanf() function is used to get the input from the user. It reads the input data from the user.
Syntax of scanf() function
scanf("string format",argument);
String Format
- %d - integer
- %c - character
- %s - string
- %f - float and etc.
Example
Write a C program to print addition of two number
#include<stdio.h>
int main(){
int a,b,c;
printf("Enter the numbers:");
scanf("%d %d",&a,&b);
c=a+b;
printf("Addition Of Two Number is:%d ",c);
return 0;
}
Quickly Find What You Are Looking For
OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.
point.com