WhatsApp us

C Input Output (I/O)

  • Tech Area
  • Last updated on: January 8, 2026


In this tutorial, We will see the example of input and output function in C programming language.

C Output

In C programming, printf() is one of the main output function.

Example: C Output

#include<stdio.h>
void main()
{
printf("C Example");  //Displays the string
}

Output

C Example

How does this program work?

To use printf() in our program, we need to include stdio.h header file using the #include <stdio.h> statement.

All valid C programs must contain the main() function. The code execution begins from the start of the main() function.

The printf() is a library function to send formatted output to the screen. The function prints the string inside quotations.

C Input

In C programming, scanf() is one of the commonly used function to take input from the user.

Example: C Input

#include<stdio.h>
void main()
{
    int number;
    printf("Enter a number: ");
    scanf("%d", &number);  
    printf("Number = %d",number);
}

Output

Enter a number: 10
Number = 10

Here, we have used %d format specifier inside the scanf() function to take int input from the user. When the user enters an integer, it is stored in the number variable.


Subscribe us via Email

Join 20,000+ subscriber

Subscribe on YouTube

PHP Projects
Matrimonial Portal Project in PHP & MySQL Last Updated: December 22, 2025
Event Management System Project in PHP & MySQL Last Updated: December 6, 2025
Online Shopping System Project in PHP MySQL Last Updated: November 26, 2025
Hostel management system project in PHP and MySQL Last Updated: February 14, 2024
Online Pizza Delivery project in PHP Last Updated: February 4, 2024
Parking Management System project in PHP Last Updated: November 5, 2023
Visitors Management System project in PHP Last Updated: August 28, 2023
SNIPE – IT Asset management system v6.1.0 Last Updated: April 21, 2023
Employee Management System project in PHP Last Updated: January 21, 2023